42 let
testURL =
"http://localhost:8888/browser/" +
43 "browser/components/sessionstore/test/browser/browser_463206_sample.html";
46 let
tab = gBrowser.addTab(testURL);
47 tab.linkedBrowser.addEventListener(
"load",
function(aEvent) {
53 function typeText(aTextField,
aValue) {
56 let
event = aTextField.ownerDocument.createEvent(
"UIEvents");
57 event.initUIEvent(
"input",
true,
true, aTextField.ownerDocument.defaultView, 0);
58 aTextField.dispatchEvent(
event);
61 let
doc = tab.linkedBrowser.contentDocument;
62 typeText(doc.getElementById(
"out1"), Date.now());
63 typeText(doc.getElementsByName(
"1|#out2")[0], Math.random());
64 typeText(doc.defaultView.frames[0].frames[1].document.getElementById(
"in1"),
new Date());
67 let
tab2 = gBrowser.duplicateTab(tab);
68 tab2.linkedBrowser.addEventListener(
"load",
function(aEvent) {
73 let doc = tab2.linkedBrowser.contentDocument;
74 let
win = tab2.linkedBrowser.contentWindow;
75 isnot(doc.getElementById(
"out1").value,
76 win.frames[1].document.getElementById(
"out1").value,
77 "text isn't reused for frames");
78 isnot(doc.getElementsByName(
"1|#out2")[0].value,
"",
79 "text containing | and # is correctly restored");
80 is(win.frames[1].document.getElementById(
"out2").value,
"",
81 "id prefixes can't be faked");
82 isnot(win.frames[0].frames[1].document.getElementById(
"in1").value,
"",
83 "id prefixes aren't mixed up");
84 is(win.frames[1].frames[0].document.getElementById(
"in1").value,
"",
85 "id prefixes aren't mixed up");
88 gBrowser.removeTab(tab2);
89 gBrowser.removeTab(tab);
function doc() browser.contentDocument
return!aWindow arguments!aWindow arguments[0]
this removeEventListener("load", this.__SS_restore, true)