| 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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" | 7 #include "chrome/browser/extensions/lazy_background_page_test_util.h" |
| 8 #include "chrome/browser/notifications/desktop_notification_profile_util.h" | 8 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "extensions/browser/process_manager.h" | 11 #include "extensions/browser/process_manager.h" |
| 12 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
| 13 | 13 |
| 14 class NotificationIdleTest : public ExtensionApiTest { | 14 class NotificationIdleTest : public ExtensionApiTest { |
| 15 protected: | 15 protected: |
| 16 virtual void SetUpOnMainThread() OVERRIDE { | 16 virtual void SetUpOnMainThread() override { |
| 17 ExtensionApiTest::SetUpOnMainThread(); | 17 ExtensionApiTest::SetUpOnMainThread(); |
| 18 | 18 |
| 19 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1); | 19 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1); |
| 20 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1); | 20 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1); |
| 21 } | 21 } |
| 22 | 22 |
| 23 const extensions::Extension* LoadExtensionAndWait( | 23 const extensions::Extension* LoadExtensionAndWait( |
| 24 const std::string& test_name) { | 24 const std::string& test_name) { |
| 25 LazyBackgroundObserver page_complete; | 25 LazyBackgroundObserver page_complete; |
| 26 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); | 26 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 53 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) { | 53 IN_PROC_BROWSER_TEST_F(NotificationIdleTest, MAYBE_NotificationsAllowUnload) { |
| 54 const extensions::Extension* extension = | 54 const extensions::Extension* extension = |
| 55 LoadExtensionAndWait("notifications/api/unload"); | 55 LoadExtensionAndWait("notifications/api/unload"); |
| 56 ASSERT_TRUE(extension) << message_; | 56 ASSERT_TRUE(extension) << message_; |
| 57 | 57 |
| 58 // Lazy Background Page has been shut down. | 58 // Lazy Background Page has been shut down. |
| 59 extensions::ProcessManager* pm = | 59 extensions::ProcessManager* pm = |
| 60 extensions::ExtensionSystem::Get(profile())->process_manager(); | 60 extensions::ExtensionSystem::Get(profile())->process_manager(); |
| 61 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); | 61 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); |
| 62 } | 62 } |
| OLD | NEW |