Index: chrome/browser/extensions/process_manager_browsertest.cc |
diff --git a/chrome/browser/extensions/process_manager_browsertest.cc b/chrome/browser/extensions/process_manager_browsertest.cc |
index 26355530e1518b72c5f6e917ab4dd61156635581..7c07b2a2c96bb7bf96ac1841d42ed365bad03b61 100644 |
--- a/chrome/browser/extensions/process_manager_browsertest.cc |
+++ b/chrome/browser/extensions/process_manager_browsertest.cc |
@@ -37,6 +37,7 @@ |
#include "extensions/browser/app_window/app_window.h" |
#include "extensions/browser/app_window/app_window_registry.h" |
#include "extensions/browser/process_manager.h" |
+#include "extensions/common/manifest_handlers/background_info.h" |
#include "extensions/common/permissions/permissions_data.h" |
#include "extensions/common/value_builder.h" |
#include "extensions/test/background_page_watcher.h" |
@@ -293,7 +294,9 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
EXPECT_TRUE(pm->GetSiteInstanceForURL(extension->url())); |
EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(extension->id()).size()); |
EXPECT_FALSE(pm->IsBackgroundHostClosing(extension->id())); |
- EXPECT_EQ(0, pm->GetLazyKeepaliveCount(extension.get())); |
+ |
+ EXPECT_TRUE(BackgroundInfo::HasPersistentBackgroundPage(extension.get())); |
+ EXPECT_EQ(-1, pm->GetLazyKeepaliveCount(extension.get())); |
// Unload the extension. |
UnloadExtension(extension->id()); |
@@ -305,7 +308,6 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
EXPECT_TRUE(pm->GetSiteInstanceForURL(extension->url())); |
EXPECT_EQ(0u, pm->GetRenderFrameHostsForExtension(extension->id()).size()); |
EXPECT_FALSE(pm->IsBackgroundHostClosing(extension->id())); |
- EXPECT_EQ(0, pm->GetLazyKeepaliveCount(extension.get())); |
} |
// Test that loading an extension with a browser action does not create a |
@@ -331,7 +333,6 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
EXPECT_EQ(0u, pm->GetRenderFrameHostsForExtension(popup->id()).size()); |
EXPECT_TRUE(pm->GetSiteInstanceForURL(popup->url())); |
EXPECT_FALSE(pm->IsBackgroundHostClosing(popup->id())); |
- EXPECT_EQ(0, pm->GetLazyKeepaliveCount(popup.get())); |
Devlin
2017/02/14 16:18:24
Any reason to not update these, rather than remove
Wez
2017/02/14 17:39:16
D'oh; done. Good point, although this test is DISA
|
// Simulate clicking on the action to open a popup. |
BrowserActionTestUtil test_util(browser()); |
@@ -350,7 +351,6 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, |
EXPECT_EQ(1u, pm->GetRenderFrameHostsForExtension(popup->id()).size()); |
EXPECT_TRUE(pm->GetSiteInstanceForURL(popup->url())); |
EXPECT_FALSE(pm->IsBackgroundHostClosing(popup->id())); |
- EXPECT_EQ(0, pm->GetLazyKeepaliveCount(popup.get())); |
} |
// Content loaded from http://hlogonemlfkgpejgnedahbkiabcdhnnn should not |
@@ -609,6 +609,7 @@ IN_PROC_BROWSER_TEST_F(ProcessManagerBrowserTest, KeepaliveOnNetworkRequest) { |
// Keepalive count at this point is unpredictable as there may be an |
// outstanding event dispatch. We use the current keepalive count as a |
// reliable baseline for future expectations. |
+ EXPECT_FALSE(BackgroundInfo::HasPersistentBackgroundPage(extension.get())); |
Devlin
2017/02/14 16:18:24
nit: prefer EXPECT_TRUE(BackgroundInfo::HasLazyBac
Wez
2017/02/14 17:39:16
Done. Also added a sanity-check for the baseline k
|
int baseline_keepalive = pm->GetLazyKeepaliveCount(extension.get()); |
// Simulate some network events. This test assumes no other network requests |