| 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 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('children_changed', assertOkButtonLocation); | 22 tree.root.addEventListener('childrenChanged', assertOkButtonLocation); |
| 23 chrome.tabs.executeScript({ 'code': | 23 chrome.tabs.executeScript({ 'code': |
| 24 'document.querySelector("button")' + | 24 'document.querySelector("button")' + |
| 25 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' + | 25 '.setAttribute("style", "position: absolute; left: 100; top: 200; ' + |
| 26 'width: 300; height: 400;");' }); | 26 'width: 300; height: 400;");' }); |
| 27 } | 27 } |
| 28 ]; | 28 ]; |
| 29 | 29 |
| 30 setUpAndRunTests(allTests); | 30 setUpAndRunTests(allTests); |
| OLD | NEW |