1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/treeupdate/test_ariadialog.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,118 @@ 1.4 +<!DOCTYPE html> 1.5 +<html> 1.6 + 1.7 +<head> 1.8 + <title>Table creation in ARIA dialog test</title> 1.9 + 1.10 + <link rel="stylesheet" type="text/css" 1.11 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.12 + 1.13 + <script type="application/javascript" 1.14 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.15 + 1.16 + <script type="application/javascript" 1.17 + src="../common.js"></script> 1.18 + <script type="application/javascript" 1.19 + src="../role.js"></script> 1.20 + <script type="application/javascript" 1.21 + src="../events.js"></script> 1.22 + 1.23 + <script type="application/javascript"> 1.24 + 1.25 + //////////////////////////////////////////////////////////////////////////// 1.26 + // Invokers 1.27 + 1.28 + function showARIADialog(aID) 1.29 + { 1.30 + this.node = getNode(aID); 1.31 + 1.32 + this.eventSeq = [ 1.33 + new invokerChecker(EVENT_SHOW, this.node) 1.34 + ]; 1.35 + 1.36 + this.invoke = function showARIADialog_invoke() 1.37 + { 1.38 + getNode("dialog").style.display = "block"; 1.39 + getNode("table").style.visibility = "visible"; 1.40 + getNode("a").textContent = "link"; 1.41 + getNode("input").value = "hello"; 1.42 + getNode("input").focus(); 1.43 + } 1.44 + 1.45 + this.finalCheck = function showARIADialog_finalCheck() 1.46 + { 1.47 + var tree = { 1.48 + role: ROLE_DIALOG, 1.49 + children: [ 1.50 + { 1.51 + role: ROLE_PUSHBUTTON, 1.52 + children: [ { role: ROLE_TEXT_LEAF } ] 1.53 + }, 1.54 + { 1.55 + role: ROLE_ENTRY 1.56 + } 1.57 + ] 1.58 + }; 1.59 + testAccessibleTree(aID, tree); 1.60 + } 1.61 + 1.62 + this.getID = function showARIADialog_getID() 1.63 + { 1.64 + return "show ARIA dialog"; 1.65 + } 1.66 + } 1.67 + 1.68 + //////////////////////////////////////////////////////////////////////////// 1.69 + // Test 1.70 + 1.71 + //gA11yEventDumpID = "eventdump"; // debug stuff 1.72 + //gA11yEventDumpToConsole = true; 1.73 + 1.74 + var gQueue = null; 1.75 + 1.76 + function doTest() 1.77 + { 1.78 + gQueue = new eventQueue(); 1.79 + 1.80 + // make the accessible an inaccessible 1.81 + gQueue.push(new showARIADialog("dialog")); 1.82 + 1.83 + gQueue.invoke(); // SimpleTest.finish() will be called in the end 1.84 + } 1.85 + 1.86 + SimpleTest.waitForExplicitFinish(); 1.87 + addA11yLoadEvent(doTest); 1.88 + </script> 1.89 +</head> 1.90 +<body> 1.91 + 1.92 + <a target="_blank" 1.93 + title="Rework accessible tree update code" 1.94 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275"> 1.95 + Mozilla Bug 570275 1.96 + </a> 1.97 + 1.98 + <p id="display"></p> 1.99 + <div id="content" style="display: none"></div> 1.100 + <pre id="test"> 1.101 + </pre> 1.102 + 1.103 + <div id="dialog" role="dialog" style="display: none;"> 1.104 + <table id="table" role="presentation" 1.105 + style="display: block; position: fixed; top: 88px; left: 312.5px; z-index: 10010; visibility: hidden;"> 1.106 + <tbody> 1.107 + <tr> 1.108 + <td role="presentation"> 1.109 + <div role="presentation"> 1.110 + <a id="a" role="button">text</a> 1.111 + </div> 1.112 + <input id="input"> 1.113 + </td> 1.114 + </tr> 1.115 + </tbody> 1.116 + </table> 1.117 + </div> 1.118 + 1.119 + <div id="eventdump"></div> 1.120 +</body> 1.121 +</html>