| OLD | NEW |
| 1 <!-- |
| 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
| 3 * source code is governed by a BSD-style license that can be found in the |
| 4 * LICENSE file. |
| 5 --> |
| 1 <head> | 6 <head> |
| 2 <script> | 7 <script src="popup.js"></script> |
| 3 function notify_pass() { | |
| 4 // We should be done. Let the test harness know. | |
| 5 chrome.test.notifyPass(); | |
| 6 } | |
| 7 | |
| 8 function run_tests() { | |
| 9 // Compute the size of the popup. | |
| 10 var width = 0; | |
| 11 var height = 0; | |
| 12 if (localStorage.height) { | |
| 13 height = parseInt(localStorage.height); | |
| 14 } | |
| 15 if (localStorage.width) { | |
| 16 width = parseInt(localStorage.width); | |
| 17 } | |
| 18 | |
| 19 // Set the div's size. | |
| 20 var test = document.getElementById("test"); | |
| 21 test.style.width = width + "px"; | |
| 22 test.style.height = height + "px"; | |
| 23 chrome.test.log("height: " + test.offsetHeight); | |
| 24 chrome.test.log("width: " + test.offsetWidth); | |
| 25 | |
| 26 height += 500; | |
| 27 width += 500; | |
| 28 localStorage.height = JSON.stringify(height); | |
| 29 localStorage.width = JSON.stringify(width); | |
| 30 | |
| 31 // Allow for the pop-up resize to happen (asynchronously) | |
| 32 // before saying that the test is done. | |
| 33 window.setTimeout(notify_pass, 0); | |
| 34 } | |
| 35 </script> | |
| 36 <style> | 8 <style> |
| 37 body { | 9 body { |
| 38 padding: 0px; | 10 padding: 0px; |
| 39 margin: 0px; | 11 margin: 0px; |
| 40 } | 12 } |
| 41 div { | 13 div { |
| 42 padding: 0px; | 14 padding: 0px; |
| 43 margin: 0px; | 15 margin: 0px; |
| 44 } | 16 } |
| 45 </style> | 17 </style> |
| 46 </head> | 18 </head> |
| 47 <body onload="window.setTimeout(run_tests, 0)"> | 19 <body> |
| 48 <div id="test">A</div> | 20 <div id="test">A</div> |
| 49 </body> | 21 </body> |
| OLD | NEW |