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

Side by Side Diff: ash/system/chromeos/power/power_status_unittest.cc

Issue 477663004: Merged FakedDBusThreadManager with DBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ash/system/chromeos/power/power_status.h" 5 #include "ash/system/chromeos/power/power_status.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 } // namespace 32 } // namespace
33 33
34 class PowerStatusTest : public testing::Test { 34 class PowerStatusTest : public testing::Test {
35 public: 35 public:
36 PowerStatusTest() : power_status_(NULL) {} 36 PowerStatusTest() : power_status_(NULL) {}
37 virtual ~PowerStatusTest() {} 37 virtual ~PowerStatusTest() {}
38 38
39 virtual void SetUp() OVERRIDE { 39 virtual void SetUp() OVERRIDE {
40 chromeos::DBusThreadManager::InitializeWithStub(); 40 chromeos::DBusThreadManager::Initialize();
41 PowerStatus::Initialize(); 41 PowerStatus::Initialize();
42 power_status_ = PowerStatus::Get(); 42 power_status_ = PowerStatus::Get();
43 test_observer_.reset(new TestObserver); 43 test_observer_.reset(new TestObserver);
44 power_status_->AddObserver(test_observer_.get()); 44 power_status_->AddObserver(test_observer_.get());
45 } 45 }
46 46
47 virtual void TearDown() OVERRIDE { 47 virtual void TearDown() OVERRIDE {
48 power_status_->RemoveObserver(test_observer_.get()); 48 power_status_->RemoveObserver(test_observer_.get());
49 test_observer_.reset(); 49 test_observer_.reset();
50 PowerStatus::Shutdown(); 50 PowerStatus::Shutdown();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_EQ(1, hours); 142 EXPECT_EQ(1, hours);
143 EXPECT_EQ(0, minutes); 143 EXPECT_EQ(0, minutes);
144 144
145 PowerStatus::SplitTimeIntoHoursAndMinutes( 145 PowerStatus::SplitTimeIntoHoursAndMinutes(
146 base::TimeDelta::FromSecondsD(3600.1), &hours, &minutes); 146 base::TimeDelta::FromSecondsD(3600.1), &hours, &minutes);
147 EXPECT_EQ(1, hours); 147 EXPECT_EQ(1, hours);
148 EXPECT_EQ(0, minutes); 148 EXPECT_EQ(0, minutes);
149 } 149 }
150 150
151 } // namespace ash 151 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698