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 {enabled: true, focusable: true, readOnly: true}, | 22 {enabled: true, 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.rootWebArea, 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 assertEq('body', body.htmlTag); |
30 state = RemoveUntestedStates(body.state); | 30 state = RemoveUntestedStates(body.state); |
31 assertEq({enabled: true, readOnly: true}, state); | 31 assertEq({enabled: true, readOnly: true}, state); |
32 | 32 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 chrome.test.succeed(); | 74 chrome.test.succeed(); |
75 }, | 75 }, |
76 function testIsRoot() { | 76 function testIsRoot() { |
77 assertTrue(rootNode.isRootNode); | 77 assertTrue(rootNode.isRootNode); |
78 assertFalse(rootNode.firstChild.isRootNode); | 78 assertFalse(rootNode.firstChild.isRootNode); |
79 chrome.test.succeed(); | 79 chrome.test.succeed(); |
80 } | 80 } |
81 ]; | 81 ]; |
82 | 82 |
83 setUpAndRunTests(allTests); | 83 setUpAndRunTests(allTests); |
OLD | NEW |