1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/sessionstore/test/browser_339445.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +function test() { 1.9 + /** Test for Bug 339445 **/ 1.10 + 1.11 + waitForExplicitFinish(); 1.12 + 1.13 + let testURL = "http://mochi.test:8888/browser/" + 1.14 + "browser/components/sessionstore/test/browser_339445_sample.html"; 1.15 + 1.16 + let tab = gBrowser.addTab(testURL); 1.17 + whenBrowserLoaded(tab.linkedBrowser, function() { 1.18 + let doc = tab.linkedBrowser.contentDocument; 1.19 + is(doc.getElementById("storageTestItem").textContent, "PENDING", 1.20 + "sessionStorage value has been set"); 1.21 + 1.22 + let tab2 = gBrowser.duplicateTab(tab); 1.23 + whenTabRestored(tab2, function() { 1.24 + let doc2 = tab2.linkedBrowser.contentDocument; 1.25 + is(doc2.getElementById("storageTestItem").textContent, "SUCCESS", 1.26 + "sessionStorage value has been duplicated"); 1.27 + 1.28 + // clean up 1.29 + gBrowser.removeTab(tab2); 1.30 + gBrowser.removeTab(tab); 1.31 + 1.32 + finish(); 1.33 + }); 1.34 + }); 1.35 +}