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.
6 function testLocation() {
7 function assertOkButtonLocation(event) {
8 var okButton = tree.root.firstChild().firstChild();
9 assertTrue('location' in okButton);
10 assertEq({left:100, top: 200, width: 300, height: 400},
12 chrome.test.succeed();
15 var okButton = tree.root.firstChild().firstChild();
16 assertTrue('location' in okButton, 'no location in okButton');
17 assertTrue('left' in okButton.location, 'no left in location');
18 assertTrue('top' in okButton.location, 'no top in location');
19 assertTrue('height' in okButton.location, 'no height in location');
20 assertTrue('width' in okButton.location, 'no width in location');
22 tree.root.addEventListener('children_changed', assertOkButtonLocation);
23 chrome.tabs.executeScript({ 'code':
24 'document.querySelector("button")' +
25 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' +
26 'width: 300; height: 400;");' });
30 setUpAndRunTests(allTests);