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 "chrome/browser/background/background_mode_manager.h" | 5 #include "chrome/browser/background/background_mode_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/test/test_simple_task_runner.h" | 17 #include "base/test/test_simple_task_runner.h" |
18 #include "base/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "chrome/browser/background/background_trigger.h" | 20 #include "chrome/browser/background/background_trigger.h" |
21 #include "chrome/browser/browser_shutdown.h" | 21 #include "chrome/browser/browser_shutdown.h" |
22 #include "chrome/browser/extensions/extension_function_test_utils.h" | 22 #include "chrome/browser/extensions/extension_function_test_utils.h" |
23 #include "chrome/browser/extensions/extension_service.h" | 23 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/extensions/test_extension_system.h" | 24 #include "chrome/browser/extensions/test_extension_system.h" |
25 #include "chrome/browser/lifetime/application_lifetime.h" | 25 #include "chrome/browser/lifetime/application_lifetime.h" |
26 #include "chrome/browser/lifetime/keep_alive_registry.h" | 26 #include "chrome/browser/lifetime/keep_alive_registry.h" |
27 #include "chrome/browser/lifetime/keep_alive_types.h" | 27 #include "chrome/browser/lifetime/keep_alive_types.h" |
28 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 28 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 // When the background mode pref is enabled and there are pending triggers | 1019 // When the background mode pref is enabled and there are pending triggers |
1020 // they will be registered and the user will be notified. | 1020 // they will be registered and the user will be notified. |
1021 EXPECT_CALL(manager, EnableLaunchOnStartup(true)); | 1021 EXPECT_CALL(manager, EnableLaunchOnStartup(true)); |
1022 g_browser_process->local_state()->SetBoolean(prefs::kBackgroundModeEnabled, | 1022 g_browser_process->local_state()->SetBoolean(prefs::kBackgroundModeEnabled, |
1023 true); | 1023 true); |
1024 Mock::VerifyAndClearExpectations(&manager); | 1024 Mock::VerifyAndClearExpectations(&manager); |
1025 ASSERT_EQ(1, manager.GetBackgroundClientCountForProfile(profile_)); | 1025 ASSERT_EQ(1, manager.GetBackgroundClientCountForProfile(profile_)); |
1026 AssertBackgroundModeActive(manager); | 1026 AssertBackgroundModeActive(manager); |
1027 ASSERT_TRUE(manager.HasShownBalloon()); | 1027 ASSERT_TRUE(manager.HasShownBalloon()); |
1028 } | 1028 } |
OLD | NEW |