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 allTests = [ | 5 var allTests = [ |
6 function testDoDefault() { | 6 function testDoDefault() { |
7 var firstTextField = findAutomationNode(rootNode, | 7 var firstTextField = findAutomationNode(rootNode, |
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 listenOnce(firstTextField, EventType.FOCUS, function(e) { | 12 listenOnce(firstTextField, 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 testDoDefaultViews() { | 18 function testDoDefaultViews() { |
19 listenOnce(rootNode, 'focus', function(node) { | 19 listenOnce(rootNode, 'focus', function(node) { |
20 chrome.test.succeed(); | 20 chrome.test.succeed(); |
21 }, true); | 21 }, true); |
22 var button = rootNode.find( | 22 var button = rootNode.find( |
23 {role: 'button', attributes: {name: 'Bookmark this page'}}); | 23 {role: 'button', attributes: {name: 'Bookmark this page'}}); |
24 button.doDefault(); | 24 button.doDefault(); |
25 }, | 25 }, |
26 | 26 |
27 function testContextMenu() { | 27 function testContextMenu() { |
28 var addressBar = rootNode.find({role: 'textField'}); | 28 var addressBar = rootNode.find({role: 'textField'}); |
29 listenOnce(rootNode, EventType.MENU_START, function(e) { | 29 listenOnce(rootNode, EventType.menuStart, function(e) { |
30 addressBar.showContextMenu(); | 30 addressBar.showContextMenu(); |
31 chrome.test.succeed(); | 31 chrome.test.succeed(); |
32 }, true); | 32 }, true); |
33 addressBar.showContextMenu(); | 33 addressBar.showContextMenu(); |
34 } | 34 } |
35 ]; | 35 ]; |
36 | 36 |
37 setUpAndRunTests(allTests); | 37 setUpAndRunTests(allTests); |
OLD | NEW |