Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 <html>
3 <head>
4 <title>frame based document testing</title>
6 <link rel="stylesheet" type="text/css"
7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
9 <script type="application/javascript"
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <script type="application/javascript"
13 src="../common.js"></script>
14 <script type="application/javascript"
15 src="../role.js"></script>
16 <script type="application/javascript"
17 src="../states.js"></script>
19 <script type="application/javascript">
20 if (navigator.platform.startsWith("Win")) {
21 SimpleTest.expectAssertions(0, 2);
22 }
24 function doTest()
25 {
26 frameDoc = document.getElementById("frame_doc").contentDocument;
27 frameDocArticle = document.getElementById("frame_doc_article").contentDocument;
28 frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
29 frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
31 testStates(frameDoc, STATE_READONLY, 0, 0, 0,
32 "test1: frameDoc");
33 testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
34 "test1: frameDocArticle");
35 testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
36 "test1: frameDocCheckbox");
37 testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
38 "test1: frameDocTextbox");
39 frameDoc.designMode = "on";
40 testStates(frameDoc, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
41 "test2: frameDoc");
42 testStates(frameDocArticle, STATE_READONLY, 0, 0, 0,
43 "test2: frameDocArticle");
44 testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
45 "test2: frameDocCheckbox");
46 testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
47 "test2: frameDocTextbox");
49 frameDocArticle.designMode = "on";
50 testStates(frameDocArticle, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0,
51 "test3: frameDocArticle");
53 frameDocCheckbox.designMode = "on";
54 testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0,
55 "test4: frameDocCheckbox");
57 // Replace iframe document body before the document accessible tree is
58 // created. Check the states are updated for new body.
59 var frameUpdateDoc =
60 document.getElementById("frame_updatedoc").contentDocument;
61 testStates(frameUpdateDoc, 0, EXT_STATE_EDITABLE,
62 STATE_READONLY, EXT_STATE_STALE, "test5: frameUpdateDoc");
64 SimpleTest.finish();
65 }
67 SimpleTest.waitForExplicitFinish();
68 addA11yLoadEvent(doTest);
69 </script>
70 </head>
72 <body>
74 <a target="_blank"
75 href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387"
76 title="Expose non-editable documents as readonly, regardless of role">
77 Mozilla Bug 467387
78 </a>
79 <a target="_blank"
80 href="https://bugzilla.mozilla.org/show_bug.cgi?id=638106"
81 title="CKEditor document should be editable">
82 Mozilla Bug 638106
83 </a>
84 <p id="display"></p>
85 <div id="content" style="display: none"></div>
86 <pre id="test">
87 </pre>
89 <iframe id="frame_doc" src="z_frames.html"></iframe>
90 <iframe id="frame_doc_article" src="z_frames_article.html"></iframe>
91 <iframe id="frame_doc_checkbox" src="z_frames_checkbox.html"></iframe>
92 <iframe id="frame_doc_textbox" src="z_frames_textbox.html"></iframe>
93 <iframe id="frame_updatedoc" src="z_frames_update.html"></iframe>
94 </body>
95 </html>