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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/browser_action/popup/popup.js
===================================================================
--- chrome/test/data/extensions/api_test/browser_action/popup/popup.js (revision 0)
+++ chrome/test/data/extensions/api_test/browser_action/popup/popup.js (revision 0)
@@ -0,0 +1,40 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function notify_pass() {
+ // We should be done. Let the test harness know.
+ chrome.test.notifyPass();
+}
+
+function run_tests() {
+ // Compute the size of the popup.
+ var width = 0;
+ var height = 0;
+ if (localStorage.height) {
+ height = parseInt(localStorage.height);
+ }
+ if (localStorage.width) {
+ width = parseInt(localStorage.width);
+ }
+
+ // Set the div's size.
+ var test = document.getElementById("test");
+ test.style.width = width + "px";
+ test.style.height = height + "px";
+ chrome.test.log("height: " + test.offsetHeight);
+ chrome.test.log("width: " + test.offsetWidth);
+
+ height += 500;
+ width += 500;
+ localStorage.height = JSON.stringify(height);
+ localStorage.width = JSON.stringify(width);
+
+ // Allow for the pop-up resize to happen (asynchronously)
+ // before saying that the test is done.
+ window.setTimeout(notify_pass, 0);
+}
+
+window.addEventListener("load", function() {
+ window.setTimeout(run_tests, 0)
+}, false);

Powered by Google App Engine
This is Rietveld 408576698