| 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/api/system_indicator/system_indicator_manage
r.h" | 5 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r.h" |
| 6 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r_factory.h" | 6 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage
r_factory.h" |
| 7 #include "chrome/browser/extensions/extension_action.h" | 7 #include "chrome/browser/extensions/extension_action.h" |
| 8 #include "chrome/browser/extensions/extension_action_manager.h" | 8 #include "chrome/browser/extensions/extension_action_manager.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/lazy_background_page_test_util.h" | 10 #include "chrome/browser/extensions/lazy_background_page_test_util.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "extensions/browser/extension_system.h" | |
| 13 #include "extensions/browser/process_manager.h" | 12 #include "extensions/browser/process_manager.h" |
| 14 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
| 15 #include "extensions/test/result_catcher.h" | 14 #include "extensions/test/result_catcher.h" |
| 16 | 15 |
| 17 class SystemIndicatorApiTest : public ExtensionApiTest { | 16 class SystemIndicatorApiTest : public ExtensionApiTest { |
| 18 public: | 17 public: |
| 19 void SetUpOnMainThread() override { | 18 void SetUpOnMainThread() override { |
| 20 ExtensionApiTest::SetUpOnMainThread(); | 19 ExtensionApiTest::SetUpOnMainThread(); |
| 21 // Set shorter delays to prevent test timeouts in tests that need to wait | 20 // Set shorter delays to prevent test timeouts in tests that need to wait |
| 22 // for the event page to unload. | 21 // for the event page to unload. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 extensions::SystemIndicatorManager* manager = | 50 extensions::SystemIndicatorManager* manager = |
| 52 extensions::SystemIndicatorManagerFactory::GetForProfile(profile()); | 51 extensions::SystemIndicatorManagerFactory::GetForProfile(profile()); |
| 53 if (manager) { | 52 if (manager) { |
| 54 extensions::ResultCatcher catcher; | 53 extensions::ResultCatcher catcher; |
| 55 | 54 |
| 56 const extensions::Extension* extension = | 55 const extensions::Extension* extension = |
| 57 LoadExtensionAndWait("system_indicator/unloaded"); | 56 LoadExtensionAndWait("system_indicator/unloaded"); |
| 58 ASSERT_TRUE(extension) << message_; | 57 ASSERT_TRUE(extension) << message_; |
| 59 | 58 |
| 60 // Lazy Background Page has been shut down. | 59 // Lazy Background Page has been shut down. |
| 61 extensions::ProcessManager* pm = | 60 extensions::ProcessManager* pm = extensions::ProcessManager::Get(profile()); |
| 62 extensions::ExtensionSystem::Get(profile())->process_manager(); | |
| 63 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); | 61 EXPECT_FALSE(pm->GetBackgroundHostForExtension(last_loaded_extension_id())); |
| 64 | 62 |
| 65 EXPECT_TRUE(manager->SendClickEventToExtensionForTest(extension->id())); | 63 EXPECT_TRUE(manager->SendClickEventToExtensionForTest(extension->id())); |
| 66 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 64 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 67 } | 65 } |
| 68 } | 66 } |
| OLD | NEW |