diff options
Diffstat (limited to 'chrome/browser/background_mode_manager_unittest.cc')
-rw-r--r-- | chrome/browser/background_mode_manager_unittest.cc | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/chrome/browser/background_mode_manager_unittest.cc b/chrome/browser/background_mode_manager_unittest.cc index cd87ce5..989c72d 100644 --- a/chrome/browser/background_mode_manager_unittest.cc +++ b/chrome/browser/background_mode_manager_unittest.cc @@ -66,52 +66,3 @@ TEST_F(BackgroundModeManagerTest, BackgroundAppInstallUninstall) { manager.OnBackgroundAppUnloaded(); manager.OnBackgroundAppUninstalled(); } - -TEST_F(BackgroundModeManagerTest, BackgroundPrefDisabled) { - InSequence s; - TestingProfile profile; - profile.GetPrefs()->SetBoolean(prefs::kBackgroundModeEnabled, false); - TestBackgroundModeManager manager(&profile, command_line_.get()); - EXPECT_CALL(manager, CreateStatusTrayIcon()).Times(0); - // Should not change launch on startup status when installing/uninstalling - // if background mode is disabled. - EXPECT_CALL(manager, EnableLaunchOnStartup(true)).Times(0); - manager.OnBackgroundAppInstalled(); - manager.OnBackgroundAppLoaded(); - EXPECT_FALSE(BrowserList::WillKeepAlive()); - manager.OnBackgroundAppUnloaded(); - manager.OnBackgroundAppUninstalled(); -} - -TEST_F(BackgroundModeManagerTest, BackgroundPrefDynamicDisable) { - InSequence s; - TestingProfile profile; - TestBackgroundModeManager manager(&profile, command_line_.get()); - EXPECT_CALL(manager, EnableLaunchOnStartup(true)); - EXPECT_CALL(manager, CreateStatusTrayIcon()); - EXPECT_CALL(manager, EnableLaunchOnStartup(false)); - EXPECT_CALL(manager, RemoveStatusTrayIcon()); - manager.OnBackgroundAppInstalled(); - manager.OnBackgroundAppLoaded(); - EXPECT_TRUE(BrowserList::WillKeepAlive()); - // Disable status on the fly. - profile.GetPrefs()->SetBoolean(prefs::kBackgroundModeEnabled, false); - // Manually notify background mode manager that pref has changed - manager.OnBackgroundModePrefChanged(); - EXPECT_FALSE(BrowserList::WillKeepAlive()); -} - -TEST_F(BackgroundModeManagerTest, BackgroundPrefDynamicEnable) { - InSequence s; - TestingProfile profile; - TestBackgroundModeManager manager(&profile, command_line_.get()); - profile.GetPrefs()->SetBoolean(prefs::kBackgroundModeEnabled, false); - EXPECT_CALL(manager, EnableLaunchOnStartup(true)); - EXPECT_CALL(manager, CreateStatusTrayIcon()); - manager.OnBackgroundAppInstalled(); - manager.OnBackgroundAppLoaded(); - EXPECT_FALSE(BrowserList::WillKeepAlive()); - // Enable status on the fly. - profile.GetPrefs()->SetBoolean(prefs::kBackgroundModeEnabled, true); - EXPECT_TRUE(BrowserList::WillKeepAlive()); -} |