OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var allTests = [ |
| 6 function testInitialFocus() { |
| 7 var url = 'data:text/html,<!doctype html>' + |
| 8 encodeURI('<input autofocus title=abc>'); |
| 9 chrome.automation.getDesktop(function(rootNode) { |
| 10 chrome.tabs.create({url: url}); |
| 11 |
| 12 rootNode.addEventListener('loadComplete', function(event) { |
| 13 if (event.target.url == url) { |
| 14 var focus = chrome.automation.getFocus(); |
| 15 assertEq('textField', focus.role); |
| 16 assertEq('abc', focus.name); |
| 17 chrome.test.succeed(); |
| 18 } |
| 19 }, false); |
| 20 }); |
| 21 }, |
| 22 ]; |
| 23 |
| 24 chrome.test.runTests(allTests); |
OLD | NEW |