OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Do not test orientation or hover attributes (similar to exclusions on native | 5 // Do not test orientation or hover attributes (similar to exclusions on native |
6 // accessibility), since they can be inconsistent depending on the environment. | 6 // accessibility), since they can be inconsistent depending on the environment. |
7 var RemoveUntestedStates = function(state) { | 7 var RemoveUntestedStates = function(state) { |
8 var result = JSON.parse(JSON.stringify(state)); | 8 var result = JSON.parse(JSON.stringify(state)); |
9 delete result[StateType.HORIZONTAL]; | 9 delete result[StateType.horizontal]; |
10 delete result[StateType.HOVERED]; | 10 delete result[StateType.hovered]; |
11 delete result[StateType.VERTICAL]; | 11 delete result[StateType.vertical]; |
12 return result; | 12 return result; |
13 }; | 13 }; |
14 | 14 |
15 var allTests = [ | 15 var allTests = [ |
16 function testSimplePage() { | 16 function testSimplePage() { |
17 var title = rootNode.docTitle; | 17 var title = rootNode.docTitle; |
18 assertEq('Automation Tests', title); | 18 assertEq('Automation Tests', title); |
19 | 19 |
20 var state = RemoveUntestedStates(rootNode.state); | 20 var state = RemoveUntestedStates(rootNode.state); |
21 assertEq( | 21 assertEq( |
22 {focusable: true, readOnly: true, focused: true}, | 22 {focusable: true, readOnly: true, focused: true}, |
23 state); | 23 state); |
24 | 24 |
25 var children = rootNode.children; | 25 var children = rootNode.children; |
26 assertEq(RoleType.ROOT_WEB_AREA, rootNode.role); | 26 assertEq(RoleType.rootWebArea, rootNode.role); |
27 assertEq(1, children.length); | 27 assertEq(1, children.length); |
28 var body = children[0]; | 28 var body = children[0]; |
| 29 assertEq('body', body.htmlTag); |
29 state = RemoveUntestedStates(body.state); | 30 state = RemoveUntestedStates(body.state); |
30 assertEq({readOnly: true}, state); | 31 assertEq({readOnly: true}, state); |
31 | 32 |
32 var contentChildren = body.children; | 33 var contentChildren = body.children; |
33 assertEq(3, contentChildren.length); | 34 assertEq(3, contentChildren.length); |
34 var okButton = contentChildren[0]; | 35 var okButton = contentChildren[0]; |
35 assertEq('Ok', okButton.name); | 36 assertEq('Ok', okButton.name); |
36 state = RemoveUntestedStates(okButton.state); | 37 state = RemoveUntestedStates(okButton.state); |
37 assertEq({focusable: true, readOnly: true}, state); | 38 assertEq({focusable: true, readOnly: true}, state); |
38 var userNameInput = contentChildren[1]; | 39 var userNameInput = contentChildren[1]; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 chrome.test.succeed(); | 74 chrome.test.succeed(); |
74 }, | 75 }, |
75 function testIsRoot() { | 76 function testIsRoot() { |
76 assertTrue(rootNode.isRootNode); | 77 assertTrue(rootNode.isRootNode); |
77 assertFalse(rootNode.firstChild.isRootNode); | 78 assertFalse(rootNode.firstChild.isRootNode); |
78 chrome.test.succeed(); | 79 chrome.test.succeed(); |
79 } | 80 } |
80 ]; | 81 ]; |
81 | 82 |
82 setUpAndRunTests(allTests); | 83 setUpAndRunTests(allTests); |
OLD | NEW |