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

Unified Diff: chrome/browser/apps/app_browsertest.cc

Issue 589223003: Deflake ComponentExtensionRuntimeReload test and re-enable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 6 years, 3 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/apps/app_browsertest.cc
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc
index 1c837c2d83972a9b0ceaa983665fba993d368225..493208e6f117fd5e9d33ce41c96682f41cf5ab93 100644
--- a/chrome/browser/apps/app_browsertest.cc
+++ b/chrome/browser/apps/app_browsertest.cc
@@ -1052,9 +1052,8 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ComponentAppBackgroundPage) {
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
}
-// Flaky: http://crbug.com/407409
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
- DISABLED_ComponentExtensionRuntimeReload) {
+ ComponentExtensionRuntimeReload) {
// Ensure that we wait until the background page is run (to register the
// OnLaunched listener) before trying to open the application. This is similar
// to LoadAndLaunchPlatformApp, but we want to load as a component extension.
@@ -1076,9 +1075,15 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
}
{
- ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait(
- extension->id(), "chrome.runtime.reload();"));
ExtensionTestMessageListener launched_listener("Launched", false);
+ ASSERT_TRUE(ExecuteScriptInBackgroundPageNoWait(
+ extension->id(),
+ // NoWait actually waits for a domAutomationController.send() which is
+ // implicitly append to the script. Since reload() restarts the
+ // extension, the send after reload may not get executed. To get around
+ // this, send first, then execute the reload().
+ "window.domAutomationController.send(0);"
+ "chrome.runtime.reload();"));
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
}
}
« 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