| Index: chrome/browser/extensions/lazy_background_page_apitest.cc
|
| diff --git a/chrome/browser/extensions/lazy_background_page_apitest.cc b/chrome/browser/extensions/lazy_background_page_apitest.cc
|
| index 02434b805888867f68f749af3f8912b5374d3008..ce37ca10518adf172377d2e21f61aa6728752a85 100644
|
| --- a/chrome/browser/extensions/lazy_background_page_apitest.cc
|
| +++ b/chrome/browser/extensions/lazy_background_page_apitest.cc
|
| @@ -310,7 +310,8 @@ IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, WaitForRequest) {
|
| // Tests that the lazy background page stays alive while a NaCl module exists in
|
| // its DOM.
|
| #if !defined(DISABLE_NACL) && !defined(DISABLE_NACL_BROWSERTESTS)
|
| -IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaCl) {
|
| +
|
| +IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaClInBackgroundPage) {
|
| {
|
| base::FilePath extdir;
|
| ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &extdir));
|
| @@ -341,6 +342,38 @@ IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaCl) {
|
| // The Lazy Background Page has been shut down.
|
| EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id()));
|
| }
|
| +
|
| +// Tests that the lazy background page shuts down when all visible views with
|
| +// NaCl modules are closed.
|
| +IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaClInView) {
|
| + // The extension is loaded and should've opened a new tab to an extension
|
| + // page, and the Lazy Background Page stays alive.
|
| + {
|
| + base::FilePath extdir;
|
| + ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &extdir));
|
| + extdir = extdir.AppendASCII("ppapi/tests/extensions/popup/newlib");
|
| + ResultCatcher catcher;
|
| + const Extension* extension = LoadExtension(extdir);
|
| + ASSERT_TRUE(extension);
|
| + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
|
| + EXPECT_EQ(
|
| + extension->GetResourceURL("popup.html").spec(),
|
| + browser()->tab_strip_model()->GetActiveWebContents()->GetURL().spec());
|
| + EXPECT_TRUE(IsBackgroundPageAlive(last_loaded_extension_id()));
|
| + }
|
| +
|
| + // Close the new tab.
|
| + {
|
| + LazyBackgroundObserver page_complete;
|
| + browser()->tab_strip_model()->CloseWebContentsAt(
|
| + browser()->tab_strip_model()->active_index(),
|
| + TabStripModel::CLOSE_NONE);
|
| + page_complete.WaitUntilClosed();
|
| + }
|
| +
|
| + // The Lazy Background Page has been shut down.
|
| + EXPECT_FALSE(IsBackgroundPageAlive(last_loaded_extension_id()));
|
| +}
|
| #endif
|
|
|
| // Tests that the lazy background page stays alive until all visible views are
|
|
|