| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 6 #include "base/scoped_ptr.h" |
| 7 #include "chrome/browser/background_mode_manager.h" | 7 #include "chrome/browser/background_mode_manager.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/test/testing_browser_process.h" |
| 11 #include "chrome/test/testing_browser_process_test.h" |
| 10 #include "chrome/test/testing_profile.h" | 12 #include "chrome/test/testing_profile.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 15 |
| 14 using testing::InSequence; | 16 using testing::InSequence; |
| 15 | 17 |
| 16 class BackgroundModeManagerTest : public testing::Test { | 18 class BackgroundModeManagerTest : public TestingBrowserProcessTest { |
| 17 public: | 19 public: |
| 18 BackgroundModeManagerTest() {} | 20 BackgroundModeManagerTest() {} |
| 19 ~BackgroundModeManagerTest() {} | 21 ~BackgroundModeManagerTest() {} |
| 20 void SetUp() { | 22 void SetUp() { |
| 21 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); | 23 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); |
| 22 } | 24 } |
| 23 scoped_ptr<CommandLine> command_line_; | 25 scoped_ptr<CommandLine> command_line_; |
| 24 }; | 26 }; |
| 25 | 27 |
| 26 class TestBackgroundModeManager : public BackgroundModeManager { | 28 class TestBackgroundModeManager : public BackgroundModeManager { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 56 // and call to AppUninstalled() set chrome to not launch on startup. | 58 // and call to AppUninstalled() set chrome to not launch on startup. |
| 57 EXPECT_CALL(manager, EnableLaunchOnStartup(true)); | 59 EXPECT_CALL(manager, EnableLaunchOnStartup(true)); |
| 58 EXPECT_CALL(manager, CreateStatusTrayIcon()); | 60 EXPECT_CALL(manager, CreateStatusTrayIcon()); |
| 59 EXPECT_CALL(manager, RemoveStatusTrayIcon()); | 61 EXPECT_CALL(manager, RemoveStatusTrayIcon()); |
| 60 EXPECT_CALL(manager, EnableLaunchOnStartup(false)); | 62 EXPECT_CALL(manager, EnableLaunchOnStartup(false)); |
| 61 manager.OnBackgroundAppInstalled(); | 63 manager.OnBackgroundAppInstalled(); |
| 62 manager.OnBackgroundAppLoaded(); | 64 manager.OnBackgroundAppLoaded(); |
| 63 manager.OnBackgroundAppUnloaded(); | 65 manager.OnBackgroundAppUnloaded(); |
| 64 manager.OnBackgroundAppUninstalled(); | 66 manager.OnBackgroundAppUninstalled(); |
| 65 } | 67 } |
| OLD | NEW |