Chromium Code Reviews| Index: chrome/browser/extensions/app_background_page_apitest.cc |
| diff --git a/chrome/browser/extensions/app_background_page_apitest.cc b/chrome/browser/extensions/app_background_page_apitest.cc |
| index 5321306501e9992e0c27003ddea8a611a915e82d..3f743f9a2702b3ed2436540d5d35d16614076d27 100644 |
| --- a/chrome/browser/extensions/app_background_page_apitest.cc |
| +++ b/chrome/browser/extensions/app_background_page_apitest.cc |
| @@ -10,9 +10,11 @@ |
| #include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/browser.h" |
| +#include "chrome/common/chrome_notification_types.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/extensions/extension.h" |
| #include "chrome/test/base/ui_test_utils.h" |
| +#include "content/test/test_notification_tracker.h" |
| #include "net/base/mock_host_resolver.h" |
| class AppBackgroundPageApiTest : public ExtensionApiTest { |
| @@ -144,6 +146,13 @@ IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, ManifestBackgroundPage) { |
| } |
| IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, NoJsBackgroundPage) { |
| + // Make sure that no BackgroundContentses get deleted (a signal that repeated |
| + // window.open calls recreate instances, instead of being no-ops) |
|
Charlie Reis
2012/04/06 21:55:24
Nice. I didn't realize we had TestNotificationTra
Mihai Parparita -not on Chrome
2012/04/06 22:22:09
Fixed.
|
| + TestNotificationTracker background_deleted_tracker; |
| + background_deleted_tracker.ListenFor( |
| + chrome::NOTIFICATION_BACKGROUND_CONTENTS_DELETED, |
| + content::Source<Profile>(browser()->profile())); |
| + |
| host_resolver()->AddRule("a.com", "127.0.0.1"); |
| ASSERT_TRUE(StartTestServer()); |
| @@ -182,6 +191,8 @@ IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, NoJsBackgroundPage) { |
| ASSERT_TRUE( |
| BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
| GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
| + |
| + EXPECT_EQ(0u, background_deleted_tracker.size()); |
| } |
| IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, NoJsManifestBackgroundPage) { |