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 var assertEq = chrome.test.assertEq; | 5 var assertEq = chrome.test.assertEq; |
6 var assertTrue = chrome.test.assertTrue; | 6 var assertTrue = chrome.test.assertTrue; |
7 | 7 |
8 // Do not test orientation or hover attributes (similar to exclusions on native | 8 // Do not test orientation or hover attributes (similar to exclusions on native |
9 // accessibility), since they can be inconsistent depending on the environment. | 9 // accessibility), since they can be inconsistent depending on the environment. |
10 var RemoveUntestedStates = function(state) { | 10 var RemoveUntestedStates = function(state) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 function listener(message, sender) { | 87 function listener(message, sender) { |
88 if (!sender.tab) | 88 if (!sender.tab) |
89 return; | 89 return; |
90 assertEq(tab.id, sender.tab.id); | 90 assertEq(tab.id, sender.tab.id); |
91 assertTrue(message['loaded']); | 91 assertTrue(message['loaded']); |
92 chrome.automation.getTree(makeAssertions); | 92 chrome.automation.getTree(makeAssertions); |
93 chrome.runtime.onMessage.removeListener(listener); | 93 chrome.runtime.onMessage.removeListener(listener); |
94 }); | 94 }); |
95 }); | 95 }); |
96 }); | 96 }); |
| 97 }, |
| 98 function testSimpleAction() { |
| 99 function makeAssertions(tree) { |
| 100 var okButton = tree.root.firstChild().firstChild(); |
| 101 okButton.addEventListener('focus', function() { |
| 102 chrome.test.succeed(); |
| 103 }, true); |
| 104 okButton.focus(); |
| 105 } |
| 106 chrome.tabs.create({url: 'test.html'}); |
| 107 chrome.automation.getTree(function(tree) { |
| 108 tree.root.addEventListener('load_complete', |
| 109 function() { |
| 110 makeAssertions(tree); |
| 111 }, true); |
| 112 }); |
97 } | 113 } |
98 ]; | 114 ]; |
99 | 115 |
100 chrome.test.runTests(allTests); | 116 chrome.test.runTests(allTests); |
OLD | NEW |