browser_485563.js (1033B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 function test() { 6 /** Test for Bug 485563 */ 7 8 waitForExplicitFinish(); 9 10 let uniqueValue = 11 Math.random() + "\u2028Second line\u2029Second paragraph\u2027"; 12 13 let tab = BrowserTestUtils.addTab(gBrowser); 14 BrowserTestUtils.browserLoaded(tab.linkedBrowser, { 15 wantLoad: "about:blank", 16 }).then(() => { 17 ss.setCustomTabValue(tab, "bug485563", uniqueValue); 18 let tabState = JSON.parse(ss.getTabState(tab)); 19 is( 20 tabState.extData.bug485563, 21 uniqueValue, 22 "unicode line separator wasn't over-encoded" 23 ); 24 ss.deleteCustomTabValue(tab, "bug485563"); 25 ss.setTabState(tab, JSON.stringify(tabState)); 26 is( 27 ss.getCustomTabValue(tab, "bug485563"), 28 uniqueValue, 29 "unicode line separator was correctly preserved" 30 ); 31 32 gBrowser.removeTab(tab); 33 finish(); 34 }); 35 }