Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: chrome/browser/background/background_mode_manager_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/background/background_mode_manager.h" 8 #include "chrome/browser/background/background_mode_manager.h"
9 #include "chrome/browser/lifetime/application_lifetime.h" 9 #include "chrome/browser/lifetime/application_lifetime.h"
10 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
11 #include "chrome/common/chrome_switches.h" 11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/test/base/testing_browser_process.h" 12 #include "chrome/test/base/testing_browser_process.h"
13 #include "chrome/test/base/testing_profile.h" 13 #include "chrome/test/base/testing_profile.h"
14 #include "chrome/test/base/testing_profile_manager.h" 14 #include "chrome/test/base/testing_profile_manager.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "ui/gfx/image/image.h" 16 #include "ui/gfx/image/image.h"
17 #include "ui/gfx/image/image_unittest_util.h" 17 #include "ui/gfx/image/image_unittest_util.h"
18 18
19 class BackgroundModeManagerTest : public testing::Test { 19 class BackgroundModeManagerTest : public testing::Test {
20 public: 20 public:
21 BackgroundModeManagerTest() 21 BackgroundModeManagerTest()
22 : profile_manager_( 22 : profile_manager_(TestingBrowserProcess::GetGlobal()) {}
23 static_cast<TestingBrowserProcess*>(g_browser_process)) {}
24 ~BackgroundModeManagerTest() {} 23 ~BackgroundModeManagerTest() {}
25 void SetUp() { 24 void SetUp() {
26 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM)); 25 command_line_.reset(new CommandLine(CommandLine::NO_PROGRAM));
27 ASSERT_TRUE(profile_manager_.SetUp()); 26 ASSERT_TRUE(profile_manager_.SetUp());
28 } 27 }
29 scoped_ptr<CommandLine> command_line_; 28 scoped_ptr<CommandLine> command_line_;
30 TestingProfileManager profile_manager_; 29 TestingProfileManager profile_manager_;
31 }; 30 };
32 31
33 class TestBackgroundModeManager : public BackgroundModeManager { 32 class TestBackgroundModeManager : public BackgroundModeManager {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 303
305 TEST_F(BackgroundModeManagerTest, 304 TEST_F(BackgroundModeManagerTest,
306 BackgroundModeDisabledPreventsKeepAliveOnStartup) { 305 BackgroundModeDisabledPreventsKeepAliveOnStartup) {
307 TestingProfile* profile1 = profile_manager_.CreateTestingProfile("p1"); 306 TestingProfile* profile1 = profile_manager_.CreateTestingProfile("p1");
308 command_line_->AppendSwitch(switches::kKeepAliveForTest); 307 command_line_->AppendSwitch(switches::kKeepAliveForTest);
309 TestBackgroundModeManager manager( 308 TestBackgroundModeManager manager(
310 command_line_.get(), profile_manager_.profile_info_cache(), false); 309 command_line_.get(), profile_manager_.profile_info_cache(), false);
311 manager.RegisterProfile(profile1); 310 manager.RegisterProfile(profile1);
312 EXPECT_FALSE(manager.ShouldBeInBackgroundMode()); 311 EXPECT_FALSE(manager.ShouldBeInBackgroundMode());
313 } 312 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698