| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" | 10 #include "chrome/browser/bookmarks/bookmark_test_helpers.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); | 167 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); |
| 168 | 168 |
| 169 // Page action is shown. | 169 // Page action is shown. |
| 170 page_action_changed.Wait(); | 170 page_action_changed.Wait(); |
| 171 EXPECT_EQ(num_page_actions + 1, | 171 EXPECT_EQ(num_page_actions + 1, |
| 172 browser()->window()->GetLocationBar()-> | 172 browser()->window()->GetLocationBar()-> |
| 173 GetLocationBarForTesting()->PageActionVisibleCount()); | 173 GetLocationBarForTesting()->PageActionVisibleCount()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, Filters) { | 176 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, Filters) { |
| 177 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 178 |
| 177 const Extension* extension = LoadExtensionAndWait("filters"); | 179 const Extension* extension = LoadExtensionAndWait("filters"); |
| 178 ASSERT_TRUE(extension); | 180 ASSERT_TRUE(extension); |
| 179 | 181 |
| 180 // Lazy Background Page doesn't exist yet. | 182 // Lazy Background Page doesn't exist yet. |
| 181 ExtensionProcessManager* pm = | 183 ExtensionProcessManager* pm = |
| 182 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); | 184 extensions::ExtensionSystem::Get(browser()->profile())->process_manager(); |
| 183 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); | 185 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); |
| 184 | 186 |
| 185 // Open a tab to a URL that will fire a webNavigation event. | 187 // Open a tab to a URL that will fire a webNavigation event. |
| 186 LazyBackgroundObserver page_complete; | 188 LazyBackgroundObserver page_complete; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 507 |
| 506 // Tests that the lazy background page will be unloaded if the onSuspend event | 508 // Tests that the lazy background page will be unloaded if the onSuspend event |
| 507 // handler calls an API function such as chrome.storage.local.set(). | 509 // handler calls an API function such as chrome.storage.local.set(). |
| 508 // See: http://crbug.com/296834 | 510 // See: http://crbug.com/296834 |
| 509 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { | 511 IN_PROC_BROWSER_TEST_F(LazyBackgroundPageApiTest, OnSuspendUseStorageApi) { |
| 510 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); | 512 EXPECT_TRUE(LoadExtensionAndWait("on_suspend")); |
| 511 } | 513 } |
| 512 | 514 |
| 513 // TODO: background page with timer. | 515 // TODO: background page with timer. |
| 514 // TODO: background page that interacts with popup. | 516 // TODO: background page that interacts with popup. |
| OLD | NEW |