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

Side by Side Diff: base/system_monitor_unittest.cc

Issue 243102: Convert base dependencies to use sys_string_conversions instead of the ICU... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/third_party/icu/README » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/system_monitor.h" 5 #include "base/system_monitor.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 class PowerTest : public base::SystemMonitor::PowerObserver { 8 class PowerTest : public base::SystemMonitor::PowerObserver {
9 public: 9 public:
10 PowerTest() 10 PowerTest()
11 : battery_(false), 11 : battery_(false),
12 power_state_changes_(0), 12 power_state_changes_(0),
13 suspends_(0), 13 suspends_(0),
14 resumes_(0) {}; 14 resumes_(0) {};
15 15
16 // PowerObserver callbacks. 16 // PowerObserver callbacks.
17 void OnPowerStateChange(bool on_battery_power) { 17 void OnPowerStateChange(bool on_battery_power) {
18 power_state_changes_++; 18 power_state_changes_++;
19 } 19 }
20 20
21 void OnSuspend() { 21 void OnSuspend() {
22 suspends_++; 22 suspends_++;
23 } 23 }
24 24
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Pretend we were awakened. 77 // Pretend we were awakened.
78 system_monitor->ProcessPowerMessage(base::SystemMonitor::RESUME_EVENT); 78 system_monitor->ProcessPowerMessage(base::SystemMonitor::RESUME_EVENT);
79 loop.RunAllPending(); 79 loop.RunAllPending();
80 EXPECT_EQ(test[0].resumes(), 1); 80 EXPECT_EQ(test[0].resumes(), 1);
81 81
82 // Send a duplicate resume notification. This should be suppressed. 82 // Send a duplicate resume notification. This should be suppressed.
83 system_monitor->ProcessPowerMessage(base::SystemMonitor::RESUME_EVENT); 83 system_monitor->ProcessPowerMessage(base::SystemMonitor::RESUME_EVENT);
84 loop.RunAllPending(); 84 loop.RunAllPending();
85 EXPECT_EQ(test[0].resumes(), 1); 85 EXPECT_EQ(test[0].resumes(), 1);
86 } 86 }
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | base/third_party/icu/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698