| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 host->render_view_host(), "abortRequest()", &result)); | 307 host->render_view_host(), "abortRequest()", &result)); |
| 308 EXPECT_TRUE(result); | 308 EXPECT_TRUE(result); |
| 309 page_complete.Wait(); | 309 page_complete.Wait(); |
| 310 | 310 |
| 311 // Lazy Background Page has been shut down. | 311 // Lazy Background Page has been shut down. |
| 312 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); | 312 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); |
| 313 } | 313 } |
| 314 | 314 |
| 315 // Tests that the lazy background page stays alive while a NaCl module exists in | 315 // Tests that the lazy background page stays alive while a NaCl module exists in |
| 316 // its DOM. | 316 // its DOM. |
| 317 #if !defined(DISABLE_NACL) | 317 #if !defined(DISABLE_NACL) && !defined(DISABLE_NACL_BROWSERTESTS) |
| 318 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaCl) { | 318 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, NaCl) { |
| 319 { | 319 { |
| 320 base::FilePath extdir; | 320 base::FilePath extdir; |
| 321 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &extdir)); | 321 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &extdir)); |
| 322 extdir = extdir.AppendASCII("ppapi/tests/extensions/load_unload/newlib"); | 322 extdir = extdir.AppendASCII("ppapi/tests/extensions/load_unload/newlib"); |
| 323 LazyBackgroundObserver page_complete; | 323 LazyBackgroundObserver page_complete; |
| 324 ASSERT_TRUE(LoadExtension(extdir)); | 324 ASSERT_TRUE(LoadExtension(extdir)); |
| 325 page_complete.Wait(); | 325 page_complete.Wait(); |
| 326 } | 326 } |
| 327 | 327 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 | 623 |
| 624 // Tests that the lazy background page will be unloaded if the onSuspend event | 624 // Tests that the lazy background page will be unloaded if the onSuspend event |
| 625 // handler calls an API function such as chrome.storage.local.set(). | 625 // handler calls an API function such as chrome.storage.local.set(). |
| 626 // See: http://crbug.com/296834 | 626 // See: http://crbug.com/296834 |
| 627 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 627 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
| 628 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 628 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
| 629 } | 629 } |
| 630 | 630 |
| 631 // TODO: background page with timer. | 631 // TODO: background page with timer. |
| 632 // TODO: background page that interacts with popup. | 632 // TODO: background page that interacts with popup. |
| OLD | NEW |