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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc

Issue 11117011: Keep browser process alive while there are platform apps with background pages running. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test Created 8 years, 2 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
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

Powered by Google App Engine
This is Rietveld 408576698