Bug 1839316: part 5) Guard the "fetchpriority" attribute behind a pref. r=kershaw...
[gecko.git] / docshell / test / chrome / bug294258_window.xhtml
blobfe47f3e70f86011b1ca0598b4ea4ed2b54e4b5a6
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
4 <window id="294258Test"
5 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
6 width="600"
7 height="600"
8 onload="setTimeout(nextTest, 0);"
9 title="bug 294258 test">
11 <script type="application/javascript" src= "chrome://mochikit/content/chrome-harness.js" />
12 <script type="application/javascript" src="docshell_helpers.js" />
13 <script type="application/javascript"><![CDATA[
15 // Define the generator-iterator for the tests.
16 var tests = testIterator();
18 ////
19 // Execute the next test in the generator function.
21 function nextTest() {
22 tests.next();
25 function $(id) { return TestWindow.getDocument().getElementById(id); }
27 ////
28 // Generator function for test steps for bug 294258:
29 // Form values should be preserved on reload.
31 function* testIterator()
33 // Load a page containing a form.
34 doPageNavigation( {
35 uri: getHttpUrl("bug294258_testcase.html"),
36 onNavComplete: nextTest
37 } );
38 yield undefined;
40 // Change the data for each of the form fields, and reload.
41 $("text").value = "text value";
42 $("checkbox").checked = true;
43 var file = SpecialPowers.Services.dirsvc.get("TmpD", Ci.nsIFile);
44 file.append("294258_test.file");
45 file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
46 let filePath = file.path;
47 $("file").value = filePath;
48 $("textarea").value = "textarea value";
49 $("radio1").checked = true;
50 $("select").selectedIndex = 2;
51 doPageNavigation( {
52 reload: true,
53 onNavComplete: nextTest
54 } );
55 yield undefined;
57 // Verify that none of the form data has changed.
58 is($("text").value, "text value", "Text value changed");
59 is($("checkbox").checked, true, "Checkbox value changed");
60 is($("file").value, filePath, "File value changed");
61 is($("textarea").value, "textarea value", "Textarea value changed");
62 is($("radio1").checked, true, "Radio value changed");
63 is($("select").selectedIndex, 2, "Select value changed");
65 // Tell the framework the test is finished.
66 finish();
69 ]]></script>
71 <browser type="content" primary="true" flex="1" id="content" src="about:blank"/>
72 </window>