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

Unified Diff: chrome/browser/ui/webui/options/browser_options_browsertest.js

Issue 476573002: Speculative fix for BrowserOptionsOverlayWebUITest.testNavigationInBackground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/browser_options_browsertest.js
diff --git a/chrome/browser/ui/webui/options/browser_options_browsertest.js b/chrome/browser/ui/webui/options/browser_options_browsertest.js
index c9055dd15c1193a316403a6cfbc517ba5fb76b06..004535cad04205f33dd136a05edd37d982869ecf 100644
--- a/chrome/browser/ui/webui/options/browser_options_browsertest.js
+++ b/chrome/browser/ui/webui/options/browser_options_browsertest.js
@@ -41,12 +41,29 @@ BrowserOptionsOverlayWebUITest.prototype = {
/** @override */
browsePreload: 'chrome://chrome/settings/autofill',
+
+ /** @override */
+ isAsync: true,
};
TEST_F('BrowserOptionsOverlayWebUITest', 'testNavigationInBackground',
function() {
assertEquals(this.browsePreload, document.location.href);
- expectTrue($('navigation').classList.contains('background'));
+
+ if ($('navigation').classList.contains('background')) {
+ testDone();
+ return;
+ }
+
+ // Wait for the message to be posted to the Uber page.
+ window.addEventListener('message', function(e) {
+ if (e.data.method == 'beginInterceptingEvents') {
+ window.setTimeout(function() {
+ assertTrue($('navigation').classList.contains('background'));
+ testDone();
+ });
+ }
+ });
});
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698