Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | <html> |
michael@0 | 2 | <!-- |
michael@0 | 3 | https://bugzilla.mozilla.org/show_bug.cgi?id=441519 |
michael@0 | 4 | --> |
michael@0 | 5 | <head> |
michael@0 | 6 | <title>nsOuterDocAccessible chrome tests</title> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <script type="application/javascript" |
michael@0 | 10 | src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 11 | |
michael@0 | 12 | <script type="application/javascript" |
michael@0 | 13 | src="common.js"></script> |
michael@0 | 14 | <script type="application/javascript" |
michael@0 | 15 | src="states.js"></script> |
michael@0 | 16 | <script type="application/javascript" |
michael@0 | 17 | src="role.js"></script> |
michael@0 | 18 | |
michael@0 | 19 | <script type="application/javascript"> |
michael@0 | 20 | // needed error return value |
michael@0 | 21 | const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG; |
michael@0 | 22 | |
michael@0 | 23 | function doTest() |
michael@0 | 24 | { |
michael@0 | 25 | // Get accessible for body tag. |
michael@0 | 26 | var docAcc = getAccessible(document); |
michael@0 | 27 | |
michael@0 | 28 | if (docAcc) { |
michael@0 | 29 | var outerDocAcc = getAccessible(docAcc.parent); |
michael@0 | 30 | |
michael@0 | 31 | if (outerDocAcc) { |
michael@0 | 32 | testRole(outerDocAcc, ROLE_INTERNAL_FRAME); |
michael@0 | 33 | |
michael@0 | 34 | // check if it is focusable. |
michael@0 | 35 | testStates(outerDocAcc, STATE_FOCUSABLE, 0); |
michael@0 | 36 | |
michael@0 | 37 | // see bug 428954: No name wanted for internal frame |
michael@0 | 38 | is(outerDocAcc.name, null, "Wrong name for internal frame!"); |
michael@0 | 39 | |
michael@0 | 40 | // see bug 440770, no actions wanted on outer doc |
michael@0 | 41 | is(outerDocAcc.actionCount, 0, |
michael@0 | 42 | "Wrong number of actions for internal frame!"); |
michael@0 | 43 | var actionTempStr; // not really used, just needs to receive a value |
michael@0 | 44 | try { |
michael@0 | 45 | actionTempStr = outerDocAcc.getActionName(0); |
michael@0 | 46 | do_throw("No exception thrown for actionName!"); |
michael@0 | 47 | } catch(e) { |
michael@0 | 48 | ok(e.result, ns_error_invalid_arg, |
michael@0 | 49 | "Wrong return value for actionName call!"); |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | try { |
michael@0 | 53 | actionTempStr = outerDocAcc.getActionDescription(0); |
michael@0 | 54 | do_throw("No exception thrown for actionDescription!"); |
michael@0 | 55 | } catch(e) { |
michael@0 | 56 | ok(e.result, ns_error_invalid_arg, |
michael@0 | 57 | "Wrong return value for actionDescription call!"); |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | try { |
michael@0 | 61 | outerDocAcc.doAction(0); |
michael@0 | 62 | do_throw("No exception thrown for doAction!"); |
michael@0 | 63 | } catch(e) { |
michael@0 | 64 | ok(e.result, ns_error_invalid_arg, |
michael@0 | 65 | "Wrong return value for doAction call!"); |
michael@0 | 66 | } |
michael@0 | 67 | } |
michael@0 | 68 | } |
michael@0 | 69 | |
michael@0 | 70 | SimpleTest.finish(); |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 74 | addA11yLoadEvent(doTest); |
michael@0 | 75 | </script> |
michael@0 | 76 | </head> |
michael@0 | 77 | <body> |
michael@0 | 78 | |
michael@0 | 79 | <a target="_blank" |
michael@0 | 80 | href="https://bugzilla.mozilla.org/show_bug.cgi?id=441519" |
michael@0 | 81 | title="nsOuterDocAccessible chrome tests"> |
michael@0 | 82 | Mozilla Bug 441519 |
michael@0 | 83 | </a> |
michael@0 | 84 | <p id="display"></p> |
michael@0 | 85 | <div id="content" style="display: none"></div> |
michael@0 | 86 | <pre id="test"> |
michael@0 | 87 | </pre> |
michael@0 | 88 | </body> |
michael@0 | 89 | </html> |