1 // Copyright (c) 2011 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.
5 function notify_pass() {
6 // We should be done. Let the test harness know.
7 chrome.test.notifyPass();
10 function run_tests() {
11 // Compute the size of the popup.
14 if (localStorage.height) {
15 height = parseInt(localStorage.height);
17 if (localStorage.width) {
18 width = parseInt(localStorage.width);
21 // Set the div's size.
22 var test = document.getElementById("test");
23 test.style.width = width + "px";
24 test.style.height = height + "px";
25 chrome.test.log("height: " + test.offsetHeight);
26 chrome.test.log("width: " + test.offsetWidth);
30 localStorage.height = JSON.stringify(height);
31 localStorage.width = JSON.stringify(width);
33 // Allow for the pop-up resize to happen (asynchronously)
34 // before saying that the test is done.
35 window.setTimeout(notify_pass, 0);
38 window.addEventListener("load", function() {
39 window.setTimeout(run_tests, 0)