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

Unified Diff: chrome/test/data/extensions/api_test/window_open/panel/test.js

Issue 1094383005: Modified two extension tests to not be dependent on low-latency DOM timers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fix Created 5 years, 8 months 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
« no previous file with comments | « chrome/test/data/extensions/api_test/bookmarks/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/window_open/panel/test.js
diff --git a/chrome/test/data/extensions/api_test/window_open/panel/test.js b/chrome/test/data/extensions/api_test/window_open/panel/test.js
index f55054db50f90d8a7ccaa018c2cbe3b9babf1822..780e31116b4b5b8b43d06eca43105d10fe3316c4 100644
--- a/chrome/test/data/extensions/api_test/window_open/panel/test.js
+++ b/chrome/test/data/extensions/api_test/window_open/panel/test.js
@@ -3,9 +3,19 @@
// found in the LICENSE file.
var panelWindowId = 0;
+var panelLoaded = false;
// This function is called by the panel during the test run.
function panelCallback() {
+ panelLoaded = true;
+ maybeReadyForTest();
+}
+
+function maybeReadyForTest() {
+ // The order of the two callbacks is not guaranteed.
+ if( panelWindowId === 0 || !panelLoaded)
+ return;
+
// We have now added a panel so the total counts is 2 (browser + panel).
chrome.test.assertEq(2, chrome.extension.getViews().length);
// Verify that we're able to get the view of the panel by its window id.
@@ -29,6 +39,7 @@ chrome.test.runTests([
chrome.test.assertEq(true, win.alwaysOnTop);
panelWindowId = win.id;
// The panel will call back to us through panelCallback (above).
+ maybeReadyForTest();
});
}
]);
« no previous file with comments | « chrome/test/data/extensions/api_test/bookmarks/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698