1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/states/test_frames.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,95 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>frame based document testing</title> 1.8 + 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.14 + 1.15 + <script type="application/javascript" 1.16 + src="../common.js"></script> 1.17 + <script type="application/javascript" 1.18 + src="../role.js"></script> 1.19 + <script type="application/javascript" 1.20 + src="../states.js"></script> 1.21 + 1.22 + <script type="application/javascript"> 1.23 + if (navigator.platform.startsWith("Win")) { 1.24 + SimpleTest.expectAssertions(0, 2); 1.25 + } 1.26 + 1.27 + function doTest() 1.28 + { 1.29 + frameDoc = document.getElementById("frame_doc").contentDocument; 1.30 + frameDocArticle = document.getElementById("frame_doc_article").contentDocument; 1.31 + frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument; 1.32 + frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument; 1.33 + 1.34 + testStates(frameDoc, STATE_READONLY, 0, 0, 0, 1.35 + "test1: frameDoc"); 1.36 + testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, 1.37 + "test1: frameDocArticle"); 1.38 + testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, 1.39 + "test1: frameDocCheckbox"); 1.40 + testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, 1.41 + "test1: frameDocTextbox"); 1.42 + frameDoc.designMode = "on"; 1.43 + testStates(frameDoc, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, 1.44 + "test2: frameDoc"); 1.45 + testStates(frameDocArticle, STATE_READONLY, 0, 0, 0, 1.46 + "test2: frameDocArticle"); 1.47 + testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, 1.48 + "test2: frameDocCheckbox"); 1.49 + testStates(frameDocTextbox, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, 1.50 + "test2: frameDocTextbox"); 1.51 + 1.52 + frameDocArticle.designMode = "on"; 1.53 + testStates(frameDocArticle, 0, EXT_STATE_EDITABLE, STATE_READONLY, 0, 1.54 + "test3: frameDocArticle"); 1.55 + 1.56 + frameDocCheckbox.designMode = "on"; 1.57 + testStates(frameDocCheckbox, 0, 0, STATE_READONLY, 0, 1.58 + "test4: frameDocCheckbox"); 1.59 + 1.60 + // Replace iframe document body before the document accessible tree is 1.61 + // created. Check the states are updated for new body. 1.62 + var frameUpdateDoc = 1.63 + document.getElementById("frame_updatedoc").contentDocument; 1.64 + testStates(frameUpdateDoc, 0, EXT_STATE_EDITABLE, 1.65 + STATE_READONLY, EXT_STATE_STALE, "test5: frameUpdateDoc"); 1.66 + 1.67 + SimpleTest.finish(); 1.68 + } 1.69 + 1.70 + SimpleTest.waitForExplicitFinish(); 1.71 + addA11yLoadEvent(doTest); 1.72 + </script> 1.73 +</head> 1.74 + 1.75 +<body> 1.76 + 1.77 + <a target="_blank" 1.78 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=467387" 1.79 + title="Expose non-editable documents as readonly, regardless of role"> 1.80 + Mozilla Bug 467387 1.81 + </a> 1.82 + <a target="_blank" 1.83 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=638106" 1.84 + title="CKEditor document should be editable"> 1.85 + Mozilla Bug 638106 1.86 + </a> 1.87 + <p id="display"></p> 1.88 + <div id="content" style="display: none"></div> 1.89 + <pre id="test"> 1.90 + </pre> 1.91 + 1.92 + <iframe id="frame_doc" src="z_frames.html"></iframe> 1.93 + <iframe id="frame_doc_article" src="z_frames_article.html"></iframe> 1.94 + <iframe id="frame_doc_checkbox" src="z_frames_checkbox.html"></iframe> 1.95 + <iframe id="frame_doc_textbox" src="z_frames_textbox.html"></iframe> 1.96 + <iframe id="frame_updatedoc" src="z_frames_update.html"></iframe> 1.97 +</body> 1.98 +</html>