| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/background/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
| 10 #include "chrome/browser/browser_shutdown.h" | 10 #include "chrome/browser/browser_shutdown.h" |
| 11 #include "chrome/browser/extensions/extension_function_test_utils.h" | 11 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/extensions/test_extension_system.h" | 13 #include "chrome/browser/extensions/test_extension_system.h" |
| 14 #include "chrome/browser/lifetime/application_lifetime.h" | 14 #include "chrome/browser/lifetime/application_lifetime.h" |
| 15 #include "chrome/browser/profiles/profile_info_cache.h" | 15 #include "chrome/browser/profiles/profile_info_cache.h" |
| 16 #include "chrome/browser/status_icons/status_icon_menu_model.h" | 16 #include "chrome/browser/status_icons/status_icon_menu_model.h" |
| 17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/test/base/testing_browser_process.h" | 18 #include "chrome/test/base/testing_browser_process.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "chrome/test/base/testing_profile_manager.h" | 20 #include "chrome/test/base/testing_profile_manager.h" |
| 21 #include "content/public/test/test_browser_thread_bundle.h" | 21 #include "content/public/test/test_browser_thread_bundle.h" |
| 22 #include "extensions/browser/extension_prefs.h" | 22 #include "extensions/browser/extension_prefs.h" |
| 23 #include "extensions/browser/extension_system.h" | 23 #include "extensions/browser/extension_system.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
| 26 #include "ui/gfx/image/image_unittest_util.h" | 26 #include "ui/gfx/image/image_unittest_util.h" |
| 27 #include "ui/message_center/message_center.h" | 27 #include "ui/message_center/message_center.h" |
| 28 | 28 |
| 29 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 30 #include "chrome/browser/chromeos/login/users/user_manager.h" | 30 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" |
| 31 #include "chrome/browser/chromeos/settings/cros_settings.h" | 31 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 32 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 32 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 // Helper class that tracks state transitions in BackgroundModeManager and | 37 // Helper class that tracks state transitions in BackgroundModeManager and |
| 38 // exposes them via getters. | 38 // exposes them via getters. |
| 39 class SimpleTestBackgroundModeManager : public BackgroundModeManager { | 39 class SimpleTestBackgroundModeManager : public BackgroundModeManager { |
| 40 public: | 40 public: |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // Installing an ephemeral app should not show the balloon. | 878 // Installing an ephemeral app should not show the balloon. |
| 879 manager_->SetHasShownBalloon(false); | 879 manager_->SetHasShownBalloon(false); |
| 880 AddEphemeralApp(ephemeral_app.get(), service); | 880 AddEphemeralApp(ephemeral_app.get(), service); |
| 881 EXPECT_FALSE(manager_->HasShownBalloon()); | 881 EXPECT_FALSE(manager_->HasShownBalloon()); |
| 882 | 882 |
| 883 // Promoting the ephemeral app to a regular installed app should now show | 883 // Promoting the ephemeral app to a regular installed app should now show |
| 884 // the balloon. | 884 // the balloon. |
| 885 service->PromoteEphemeralApp(ephemeral_app.get(), false /*from sync*/); | 885 service->PromoteEphemeralApp(ephemeral_app.get(), false /*from sync*/); |
| 886 EXPECT_TRUE(manager_->HasShownBalloon()); | 886 EXPECT_TRUE(manager_->HasShownBalloon()); |
| 887 } | 887 } |
| OLD | NEW |