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

Side by Side Diff: chrome/browser/chromeos/power/power_prefs_unittest.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/power/power_prefs.h" 5 #include "chrome/browser/chromeos/power/power_prefs.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 PowerPolicyController* power_policy_controller_; // Not owned. 55 PowerPolicyController* power_policy_controller_; // Not owned.
56 FakePowerManagerClient* fake_power_manager_client_; // Not owned. 56 FakePowerManagerClient* fake_power_manager_client_; // Not owned.
57 57
58 scoped_ptr<PowerPrefs> power_prefs_; 58 scoped_ptr<PowerPrefs> power_prefs_;
59 59
60 DISALLOW_COPY_AND_ASSIGN(PowerPrefsTest); 60 DISALLOW_COPY_AND_ASSIGN(PowerPrefsTest);
61 }; 61 };
62 62
63 PowerPrefsTest::PowerPrefsTest() 63 PowerPrefsTest::PowerPrefsTest()
64 : profile_manager_(TestingBrowserProcess::GetGlobal()), 64 : profile_manager_(TestingBrowserProcess::GetGlobal()),
65 power_policy_controller_( 65 power_policy_controller_(new PowerPolicyController),
66 fake_dbus_thread_manager_.GetPowerPolicyController()), 66 fake_power_manager_client_(new FakePowerManagerClient) {
67 fake_power_manager_client_( 67 fake_dbus_thread_manager_.SetPowerManagerClient(
68 fake_dbus_thread_manager_.fake_power_manager_client()) { 68 scoped_ptr<PowerManagerClient>(fake_power_manager_client_));
69 fake_dbus_thread_manager_.SetPowerPolicyController(
70 scoped_ptr<PowerPolicyController>(power_policy_controller_));
71 power_policy_controller_->Init(&fake_dbus_thread_manager_);
69 } 72 }
70 73
71 void PowerPrefsTest::SetUp() { 74 void PowerPrefsTest::SetUp() {
72 testing::Test::SetUp(); 75 testing::Test::SetUp();
73 ASSERT_TRUE(profile_manager_.SetUp()); 76 ASSERT_TRUE(profile_manager_.SetUp());
74 77
75 power_prefs_.reset(new PowerPrefs(power_policy_controller_)); 78 power_prefs_.reset(new PowerPrefs(power_policy_controller_));
76 EXPECT_FALSE(GetProfile()); 79 EXPECT_FALSE(GetProfile());
77 EXPECT_EQ(PowerPolicyController::GetPolicyDebugString( 80 EXPECT_EQ(PowerPolicyController::GetPolicyDebugString(
78 power_manager::PowerManagementPolicy()), 81 power_manager::PowerManagementPolicy()),
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 content::Source<Profile>(user_profile), 260 content::Source<Profile>(user_profile),
258 content::NotificationService::NoDetails()); 261 content::NotificationService::NoDetails());
259 262
260 EXPECT_FALSE(GetProfile()); 263 EXPECT_FALSE(GetProfile());
261 EXPECT_EQ(PowerPolicyController::GetPolicyDebugString( 264 EXPECT_EQ(PowerPolicyController::GetPolicyDebugString(
262 power_manager::PowerManagementPolicy()), 265 power_manager::PowerManagementPolicy()),
263 GetCurrentPowerPolicy()); 266 GetCurrentPowerPolicy());
264 } 267 }
265 268
266 } // namespace chromeos 269 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698