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]; |
(...skipping 19 matching lines...) Expand all Loading... |
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 |
33 var contentChildren = body.children; | 33 var contentChildren = body.children; |
34 assertEq(3, contentChildren.length); | 34 assertEq(3, contentChildren.length); |
35 var okButton = contentChildren[0]; | 35 var okButton = contentChildren[0]; |
36 assertEq('Ok', okButton.name); | 36 assertEq('Ok', okButton.name); |
37 state = RemoveUntestedStates(okButton.state); | 37 state = RemoveUntestedStates(okButton.state); |
38 assertEq({enabled: true, focusable: true, readOnly: true}, state); | 38 assertEq({enabled: true, focusable: true, readOnly: true}, state); |
39 var userNameInput = contentChildren[1]; | 39 var userNameInput = contentChildren[1]; |
40 assertEq('Username', | 40 assertEq('Username', userNameInput.name); |
41 userNameInput.description); | |
42 state = RemoveUntestedStates(userNameInput.state); | 41 state = RemoveUntestedStates(userNameInput.state); |
43 assertEq({editable: true, enabled: true, focusable: true}, state); | 42 assertEq({editable: true, enabled: true, focusable: true}, state); |
44 var cancelButton = contentChildren[2]; | 43 var cancelButton = contentChildren[2]; |
45 assertEq('Cancel', | 44 assertEq('Cancel', |
46 cancelButton.name); | 45 cancelButton.name); |
47 state = RemoveUntestedStates(cancelButton.state); | 46 state = RemoveUntestedStates(cancelButton.state); |
48 assertEq({enabled: true, focusable: true, readOnly: true}, state); | 47 assertEq({enabled: true, focusable: true, readOnly: true}, state); |
49 | 48 |
50 // Traversal. | 49 // Traversal. |
51 assertEq(undefined, rootNode.parent); | 50 assertEq(undefined, rootNode.parent); |
(...skipping 23 matching lines...) Expand all Loading... |
75 chrome.test.succeed(); | 74 chrome.test.succeed(); |
76 }, | 75 }, |
77 function testIsRoot() { | 76 function testIsRoot() { |
78 assertTrue(rootNode.isRootNode); | 77 assertTrue(rootNode.isRootNode); |
79 assertFalse(rootNode.firstChild.isRootNode); | 78 assertFalse(rootNode.firstChild.isRootNode); |
80 chrome.test.succeed(); | 79 chrome.test.succeed(); |
81 } | 80 } |
82 ]; | 81 ]; |
83 | 82 |
84 setUpAndRunTests(allTests); | 83 setUpAndRunTests(allTests); |
OLD | NEW |