michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: /** Test for Bug 485563 **/ michael@0: michael@0: waitForExplicitFinish(); michael@0: michael@0: let uniqueValue = Math.random() + "\u2028Second line\u2029Second paragraph\u2027"; michael@0: michael@0: let tab = gBrowser.addTab(); michael@0: whenBrowserLoaded(tab.linkedBrowser, function() { michael@0: ss.setTabValue(tab, "bug485563", uniqueValue); michael@0: let tabState = JSON.parse(ss.getTabState(tab)); michael@0: is(tabState.extData["bug485563"], uniqueValue, michael@0: "unicode line separator wasn't over-encoded"); michael@0: ss.deleteTabValue(tab, "bug485563"); michael@0: ss.setTabState(tab, JSON.stringify(tabState)); michael@0: is(ss.getTabValue(tab, "bug485563"), uniqueValue, michael@0: "unicode line separator was correctly preserved"); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: finish(); michael@0: }); michael@0: }