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

Unified Diff: chrome/browser/extensions/service_worker_apitest.cc

Issue 1987393003: Fix ServiceWorkerPushMessagingTest.OnPush. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enable test Created 4 years, 7 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/extensions/service_worker_apitest.cc
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc
index 3ddfc9cfe29a67025a9c1f779c93fdd8b0829cf1..0110014783c050aafa00603de7c472dd5ad53b7c 100644
--- a/chrome/browser/extensions/service_worker_apitest.cc
+++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -697,14 +697,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerTest,
<< message_;
}
-// Flaky on ChromiumOS bots. http://crbug.com/612673
-// Flaky on Windows bots. http://crbug.com/612840
-#if defined(OS_CHROMEOS) || defined(OS_WIN)
-#define MAYBE_OnPush DISABLED_OnPush
-#else
-#define MAYBE_OnPush OnPush
-#endif
-IN_PROC_BROWSER_TEST_F(ServiceWorkerPushMessagingTest, MAYBE_OnPush) {
+IN_PROC_BROWSER_TEST_F(ServiceWorkerPushMessagingTest, OnPush) {
const Extension* extension = LoadExtensionWithFlags(
test_data_dir_.AppendASCII("service_worker/push_messaging"), kFlagNone);
ASSERT_TRUE(extension);
@@ -730,6 +723,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerPushMessagingTest, MAYBE_OnPush) {
ASSERT_EQ(app_identifier.app_id(), gcm_service()->last_registered_app_id());
EXPECT_EQ("1234567890", gcm_service()->last_registered_sender_ids()[0]);
+ base::RunLoop run_loop;
// Send a push message via gcm and expect the ServiceWorker to receive it.
ExtensionTestMessageListener push_message_listener("OK", false);
push_message_listener.set_failure_message("FAIL");
@@ -737,8 +731,10 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerPushMessagingTest, MAYBE_OnPush) {
message.sender_id = "1234567890";
message.raw_data = "testdata";
message.decrypted = true;
+ push_service()->SetMessageCallbackForTesting(run_loop.QuitClosure());
push_service()->OnMessage(app_identifier.app_id(), message);
EXPECT_TRUE(push_message_listener.WaitUntilSatisfied());
+ run_loop.Run(); // Wait until the message is handled by push service.
}
} // namespace extensions
« 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