| 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/notifications/desktop_notification_service.h" | 7 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 8 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 8 #include "chrome/browser/notifications/desktop_notification_service_factory.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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 protected: | 31 protected: |
| 32 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 32 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 33 ExtensionApiTest::SetUpCommandLine(command_line); | 33 ExtensionApiTest::SetUpCommandLine(command_line); |
| 34 command_line->AppendSwitch( | 34 command_line->AppendSwitch( |
| 35 message_center::switches::kDisableRichNotifications); | 35 message_center::switches::kDisableRichNotifications); |
| 36 } | 36 } |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 class NotificationIdleTest : public RichWebkitNotificationTest { | 39 class NotificationIdleTest : public RichWebkitNotificationTest { |
| 40 protected: | 40 protected: |
| 41 virtual void SetUpCommandLine(CommandLine* command_line) { | 41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 42 RichWebkitNotificationTest::SetUpCommandLine(command_line); | 42 RichWebkitNotificationTest::SetUpCommandLine(command_line); |
| 43 | 43 |
| 44 command_line->AppendSwitchASCII(switches::kEventPageIdleTime, "1"); | 44 command_line->AppendSwitchASCII(switches::kEventPageIdleTime, "1"); |
| 45 command_line->AppendSwitchASCII(switches::kEventPageSuspendingTime, "1"); | 45 command_line->AppendSwitchASCII(switches::kEventPageSuspendingTime, "1"); |
| 46 } | 46 } |
| 47 | 47 |
| 48 const extensions::Extension* LoadExtensionAndWait( | 48 const extensions::Extension* LoadExtensionAndWait( |
| 49 const std::string& test_name) { | 49 const std::string& test_name) { |
| 50 LazyBackgroundObserver page_complete; | 50 LazyBackgroundObserver page_complete; |
| 51 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); | 51 base::FilePath extdir = test_data_dir_.AppendASCII(test_name); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 const extensions::Extension* extension = | 120 const extensions::Extension* extension = |
| 121 LoadExtensionAndWait("notifications/api/unload"); | 121 LoadExtensionAndWait("notifications/api/unload"); |
| 122 ASSERT_TRUE(extension) << message_; | 122 ASSERT_TRUE(extension) << message_; |
| 123 | 123 |
| 124 // Lazy Background Page has been shut down. | 124 // Lazy Background Page has been shut down. |
| 125 ExtensionProcessManager* pm = | 125 ExtensionProcessManager* pm = |
| 126 extensions::ExtensionSystem::Get(profile())->process_manager(); | 126 extensions::ExtensionSystem::Get(profile())->process_manager(); |
| 127 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); | 127 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id_)); |
| 128 } | 128 } |
| 129 #endif | 129 #endif |
| OLD | NEW |