Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/desktop/actions.js

Issue 304293002: Add human readable programmatic enum name/values to chrome.automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Last feedback. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 allTests = [ 5 var allTests = [
6 function testDoDefault() { 6 function testDoDefault() {
7 var firstTextField = findAutomationNode(tree.root, 7 var firstTextField = findAutomationNode(tree.root,
8 function(node) { 8 function(node) {
9 return node.role == 'textField'; 9 return node.role == 'textField';
10 }); 10 });
11 assertTrue(!!firstTextField); 11 assertTrue(!!firstTextField);
12 firstTextField.addEventListener('focus', function(e) { 12 firstTextField.addEventListener(EventType.focus, function(e) {
13 chrome.test.succeed(); 13 chrome.test.succeed();
14 }, true); 14 }, true);
15 firstTextField.doDefault(); 15 firstTextField.doDefault();
16 }, 16 },
17 17
18 function testFocus() { 18 function testFocus() {
19 var firstFocusableNode = findAutomationNode(tree.root, 19 var firstFocusableNode = findAutomationNode(tree.root,
20 function(node) { 20 function(node) {
21 return node.role == 'button' && node.state.focusable; 21 return node.role == 'button' && node.state.focusable;
22 }); 22 });
23 assertTrue(!!firstFocusableNode); 23 assertTrue(!!firstFocusableNode);
24 firstFocusableNode.addEventListener('focus', function(e) { 24 firstFocusableNode.addEventListener(EventType.focus, function(e) {
25 chrome.test.succeed(); 25 chrome.test.succeed();
26 }, true); 26 }, true);
27 firstFocusableNode.focus(); 27 firstFocusableNode.focus();
28 } 28 }
29 ]; 29 ];
30 30
31 setupAndRunTests(allTests); 31 setupAndRunTests(allTests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698