Index: chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc |
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc b/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc |
index a3aee648f7659115ea4f8ba98963a2a537295558..61564c549fdb5012e921f951395c6a8ba1883b4f 100644 |
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc |
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc |
@@ -55,7 +55,7 @@ class PushMessagingApiTest : public ExtensionApiTest { |
IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, EventDispatch) { |
ResultCatcher catcher; |
catcher.RestrictToProfile(browser()->profile()); |
- ExtensionTestMessageListener ready("ready", true); |
+ ExtensionTestMessageListener ready("ready", false); |
const extensions::Extension* extension = |
LoadExtension(test_data_dir_.AppendASCII("push_messaging")); |
@@ -67,6 +67,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, EventDispatch) { |
GetEventRouter()->TriggerMessageForTest(extension->id(), 1, "payload"); |
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
+ CloseShellWindowsAndWaitForAppToExit(); |
} |
// Test that a push introduced into the sync code makes it to the extension |
@@ -74,7 +75,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, EventDispatch) { |
IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, ReceivesPush) { |
ResultCatcher catcher; |
catcher.RestrictToProfile(browser()->profile()); |
- ExtensionTestMessageListener ready("ready", true); |
+ ExtensionTestMessageListener ready("ready", false); |
const extensions::Extension* extension = |
LoadExtension(test_data_dir_.AppendASCII("push_messaging")); |
@@ -96,6 +97,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, ReceivesPush) { |
pss->EmitInvalidationForTest(object_id, "payload"); |
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
+ CloseShellWindowsAndWaitForAppToExit(); |
} |
// Checks that an extension with the pushMessaging permission gets automatically |
@@ -126,8 +128,11 @@ IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, PRE_Restart) { |
static_cast<PushMessagingInvalidationHandler*>( |
GetEventRouter()->GetMapperForTest()); |
EXPECT_TRUE(handler->GetRegisteredExtensionsForTest().empty()); |
+ ExtensionTestMessageListener ready("ready", false); |
ASSERT_TRUE(InstallExtension(test_data_dir_.AppendASCII("push_messaging"), |
1 /* new install */)); |
+ EXPECT_TRUE(ready.WaitUntilSatisfied()); |
+ CloseShellWindowsAndWaitForAppToExit(); |
} |
IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, Restart) { |
@@ -153,6 +158,7 @@ IN_PROC_BROWSER_TEST_F(PushMessagingApiTest, GetChannelId) { |
// Make sure we got a failure (but we do get a result). |
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
+ CloseShellWindowsAndWaitForAppToExit(); |
} |
} // namespace extensions |