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

Side by Side Diff: chrome/test/data/extensions/api_test/browser_action/popup/popup.js

Issue 8729014: Move a bunch of extension API tests to manifest_version 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
(Empty)
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.
4
5 function notify_pass() {
6 // We should be done. Let the test harness know.
7 chrome.test.notifyPass();
8 }
9
10 function run_tests() {
11 // Compute the size of the popup.
12 var width = 0;
13 var height = 0;
14 if (localStorage.height) {
15 height = parseInt(localStorage.height);
16 }
17 if (localStorage.width) {
18 width = parseInt(localStorage.width);
19 }
20
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);
27
28 height += 500;
29 width += 500;
30 localStorage.height = JSON.stringify(height);
31 localStorage.width = JSON.stringify(width);
32
33 // Allow for the pop-up resize to happen (asynchronously)
34 // before saying that the test is done.
35 window.setTimeout(notify_pass, 0);
36 }
37
38 window.addEventListener("load", function() {
39 window.setTimeout(run_tests, 0)
40 }, false);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698