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

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/location.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 testLocation() { 6 function testLocation() {
7 function assertOkButtonLocation(event) { 7 function assertOkButtonLocation(event) {
8 var okButton = tree.root.firstChild().firstChild(); 8 var okButton = tree.root.firstChild().firstChild();
9 assertTrue('location' in okButton); 9 assertTrue('location' in okButton);
10 assertEq({left:100, top: 200, width: 300, height: 400}, 10 assertEq({left:100, top: 200, width: 300, height: 400},
11 okButton.location); 11 okButton.location);
12 chrome.test.succeed(); 12 chrome.test.succeed();
13 }; 13 };
14 14
15 var okButton = tree.root.firstChild().firstChild(); 15 var okButton = tree.root.firstChild().firstChild();
16 assertTrue('location' in okButton, 'no location in okButton'); 16 assertTrue('location' in okButton, 'no location in okButton');
17 assertTrue('left' in okButton.location, 'no left in location'); 17 assertTrue('left' in okButton.location, 'no left in location');
18 assertTrue('top' in okButton.location, 'no top in location'); 18 assertTrue('top' in okButton.location, 'no top in location');
19 assertTrue('height' in okButton.location, 'no height in location'); 19 assertTrue('height' in okButton.location, 'no height in location');
20 assertTrue('width' in okButton.location, 'no width in location'); 20 assertTrue('width' in okButton.location, 'no width in location');
21 21
22 tree.root.addEventListener('childrenChanged', assertOkButtonLocation); 22 tree.root.addEventListener(
23 EventType.childrenChanged, assertOkButtonLocation);
23 chrome.tabs.executeScript({ 'code': 24 chrome.tabs.executeScript({ 'code':
24 'document.querySelector("button")' + 25 'document.querySelector("button")' +
25 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' + 26 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' +
26 'width: 300; height: 400;");' }); 27 'width: 300; height: 400;");' });
27 } 28 }
28 ]; 29 ];
29 30
30 setUpAndRunTests(allTests); 31 setUpAndRunTests(allTests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698