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 chrome.test.succeed(); | |
David Tseng
2016/01/28 02:00:56
This looks wrong.
dmazzoni
2016/01/30 00:02:41
Wow! Yeah, not much of a test. Luckily that was an
| |
8 var url = 'data:text/html,<!doctype html>' + | |
9 encodeURI('<input autofocus title=abc>'); | |
10 chrome.automation.getDesktop(function(rootNode) { | |
11 chrome.tabs.create({url: url}); | |
12 | |
13 rootNode.addEventListener('loadComplete', function(event) { | |
14 if (event.target.url == url) { | |
15 var focus = chrome.automation.getFocus(); | |
16 assertEq('textField', focus.role); | |
17 assertEq('abc', focus.name); | |
18 chrome.test.succeed(); | |
19 } | |
20 }, false); | |
21 }); | |
22 }, | |
23 ]; | |
24 | |
25 chrome.test.runTests(allTests); | |
OLD | NEW |