| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/background/background_mode_manager.h" | 5 #include "chrome/browser/background/background_mode_manager.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
| 9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
| 10 | 10 |
| 11 class TestBackgroundModeManager : public BackgroundModeManager { | 11 class TestBackgroundModeManager : public BackgroundModeManager { |
| 12 public: | 12 public: |
| 13 TestBackgroundModeManager(CommandLine* command_line, | 13 TestBackgroundModeManager(CommandLine* command_line, |
| 14 ProfileInfoCache* profile_cache) | 14 ProfileInfoCache* profile_cache) |
| 15 : BackgroundModeManager(command_line, profile_cache), | 15 : BackgroundModeManager(command_line, profile_cache), |
| 16 showed_background_app_installed_notification_for_test_(false) {} | 16 showed_background_app_installed_notification_for_test_(false) {} |
| 17 | 17 |
| 18 virtual ~TestBackgroundModeManager() {} | 18 virtual ~TestBackgroundModeManager() {} |
| 19 | 19 |
| 20 virtual void DisplayAppInstalledNotification( | 20 virtual void DisplayAppInstalledNotification( |
| 21 const extensions::Extension* extension) OVERRIDE { | 21 const extensions::Extension* extension) override { |
| 22 showed_background_app_installed_notification_for_test_ = true; | 22 showed_background_app_installed_notification_for_test_ = true; |
| 23 } | 23 } |
| 24 | 24 |
| 25 bool showed_background_app_installed_notification_for_test() { | 25 bool showed_background_app_installed_notification_for_test() { |
| 26 return showed_background_app_installed_notification_for_test_; | 26 return showed_background_app_installed_notification_for_test_; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void set_showed_background_app_installed_notification_for_test( | 29 void set_showed_background_app_installed_notification_for_test( |
| 30 bool showed) { | 30 bool showed) { |
| 31 showed_background_app_installed_notification_for_test_ = showed; | 31 showed_background_app_installed_notification_for_test_ = showed; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Set the test flag to not shown. | 69 // Set the test flag to not shown. |
| 70 manager->set_showed_background_app_installed_notification_for_test(false); | 70 manager->set_showed_background_app_installed_notification_for_test(false); |
| 71 | 71 |
| 72 // Reload our background extension | 72 // Reload our background extension |
| 73 ReloadExtension(extension->id()); | 73 ReloadExtension(extension->id()); |
| 74 | 74 |
| 75 // Ensure that we did not see a "Background extension loaded" dialog. | 75 // Ensure that we did not see a "Background extension loaded" dialog. |
| 76 EXPECT_FALSE( | 76 EXPECT_FALSE( |
| 77 manager->showed_background_app_installed_notification_for_test()); | 77 manager->showed_background_app_installed_notification_for_test()); |
| 78 } | 78 } |
| OLD | NEW |