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

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/location.js

Issue 595413002: Draw an accessibility focus ring around the focused object in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix automation browser test Created 6 years, 2 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
« no previous file with comments | « chrome/browser/ui/ash/accessibility/automation_manager_ash.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 testLocation() { 6 function testLocation() {
7 function assertOkButtonLocation(event) { 7 function assertOkButtonLocation(event) {
8 var okButton = rootNode.firstChild().firstChild(); 8 var okButton = rootNode.firstChild().firstChild();
9 assertTrue('location' in okButton); 9 assertTrue('location' in okButton);
10 assertEq({left:100, top: 200, width: 300, height: 400}, 10
11 okButton.location); 11 // We can't assert the left and top positions because they're
12 // returned in global screen coordinates. Just check the width and
13 // height.
14 assertEq(300, okButton.location.width);
15 assertEq(400, okButton.location.height);
12 chrome.test.succeed(); 16 chrome.test.succeed();
13 }; 17 };
14 18
15 var okButton = rootNode.firstChild().firstChild(); 19 var okButton = rootNode.firstChild().firstChild();
16 assertTrue('location' in okButton, 'no location in okButton'); 20 assertTrue('location' in okButton, 'no location in okButton');
17 assertTrue('left' in okButton.location, 'no left in location'); 21 assertTrue('left' in okButton.location, 'no left in location');
18 assertTrue('top' in okButton.location, 'no top in location'); 22 assertTrue('top' in okButton.location, 'no top in location');
19 assertTrue('height' in okButton.location, 'no height in location'); 23 assertTrue('height' in okButton.location, 'no height in location');
20 assertTrue('width' in okButton.location, 'no width in location'); 24 assertTrue('width' in okButton.location, 'no width in location');
21 25
22 rootNode.addEventListener( 26 rootNode.addEventListener(
23 EventType.childrenChanged, assertOkButtonLocation); 27 EventType.childrenChanged, assertOkButtonLocation);
24 chrome.tabs.executeScript({ 'code': 28 chrome.tabs.executeScript({ 'code':
25 'document.querySelector("button")' + 29 'document.querySelector("button")' +
26 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' + 30 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' +
27 'width: 300; height: 400;");' }); 31 'width: 300; height: 400;");' });
28 } 32 }
29 ]; 33 ];
30 34
31 setUpAndRunTests(allTests); 35 setUpAndRunTests(allTests);
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/accessibility/automation_manager_ash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698