1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/test_OuterDocAccessible.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,89 @@ 1.4 +<html> 1.5 +<!-- 1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=441519 1.7 +--> 1.8 +<head> 1.9 + <title>nsOuterDocAccessible chrome tests</title> 1.10 + <link rel="stylesheet" type="text/css" 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="states.js"></script> 1.19 + <script type="application/javascript" 1.20 + src="role.js"></script> 1.21 + 1.22 + <script type="application/javascript"> 1.23 + // needed error return value 1.24 + const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG; 1.25 + 1.26 + function doTest() 1.27 + { 1.28 + // Get accessible for body tag. 1.29 + var docAcc = getAccessible(document); 1.30 + 1.31 + if (docAcc) { 1.32 + var outerDocAcc = getAccessible(docAcc.parent); 1.33 + 1.34 + if (outerDocAcc) { 1.35 + testRole(outerDocAcc, ROLE_INTERNAL_FRAME); 1.36 + 1.37 + // check if it is focusable. 1.38 + testStates(outerDocAcc, STATE_FOCUSABLE, 0); 1.39 + 1.40 + // see bug 428954: No name wanted for internal frame 1.41 + is(outerDocAcc.name, null, "Wrong name for internal frame!"); 1.42 + 1.43 + // see bug 440770, no actions wanted on outer doc 1.44 + is(outerDocAcc.actionCount, 0, 1.45 + "Wrong number of actions for internal frame!"); 1.46 + var actionTempStr; // not really used, just needs to receive a value 1.47 + try { 1.48 + actionTempStr = outerDocAcc.getActionName(0); 1.49 + do_throw("No exception thrown for actionName!"); 1.50 + } catch(e) { 1.51 + ok(e.result, ns_error_invalid_arg, 1.52 + "Wrong return value for actionName call!"); 1.53 + } 1.54 + 1.55 + try { 1.56 + actionTempStr = outerDocAcc.getActionDescription(0); 1.57 + do_throw("No exception thrown for actionDescription!"); 1.58 + } catch(e) { 1.59 + ok(e.result, ns_error_invalid_arg, 1.60 + "Wrong return value for actionDescription call!"); 1.61 + } 1.62 + 1.63 + try { 1.64 + outerDocAcc.doAction(0); 1.65 + do_throw("No exception thrown for doAction!"); 1.66 + } catch(e) { 1.67 + ok(e.result, ns_error_invalid_arg, 1.68 + "Wrong return value for doAction call!"); 1.69 + } 1.70 + } 1.71 + } 1.72 + 1.73 + SimpleTest.finish(); 1.74 + } 1.75 + 1.76 + SimpleTest.waitForExplicitFinish(); 1.77 + addA11yLoadEvent(doTest); 1.78 + </script> 1.79 +</head> 1.80 +<body> 1.81 + 1.82 + <a target="_blank" 1.83 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=441519" 1.84 + title="nsOuterDocAccessible chrome tests"> 1.85 + Mozilla Bug 441519 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 +</body> 1.92 +</html>