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

Side by Side Diff: ui/base/system_monitor/system_monitor_unittest.cc

Issue 6361002: Move SystemMonitor to src/chrome/common.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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) 2009 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 "app/system_monitor.h" 5 #include "ui/base/system_monitor/system_monitor.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace ui {
9
8 class PowerTest : public SystemMonitor::PowerObserver { 10 class PowerTest : public SystemMonitor::PowerObserver {
9 public: 11 public:
10 PowerTest() 12 PowerTest()
11 : battery_(false), 13 : battery_(false),
12 power_state_changes_(0), 14 power_state_changes_(0),
13 suspends_(0), 15 suspends_(0),
14 resumes_(0) { 16 resumes_(0) {
15 } 17 }
16 18
17 // PowerObserver callbacks. 19 // PowerObserver callbacks.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // Pretend we were awakened. 80 // Pretend we were awakened.
79 system_monitor.ProcessPowerMessage(SystemMonitor::RESUME_EVENT); 81 system_monitor.ProcessPowerMessage(SystemMonitor::RESUME_EVENT);
80 loop.RunAllPending(); 82 loop.RunAllPending();
81 EXPECT_EQ(test[0].resumes(), 1); 83 EXPECT_EQ(test[0].resumes(), 1);
82 84
83 // Send a duplicate resume notification. This should be suppressed. 85 // Send a duplicate resume notification. This should be suppressed.
84 system_monitor.ProcessPowerMessage(SystemMonitor::RESUME_EVENT); 86 system_monitor.ProcessPowerMessage(SystemMonitor::RESUME_EVENT);
85 loop.RunAllPending(); 87 loop.RunAllPending();
86 EXPECT_EQ(test[0].resumes(), 1); 88 EXPECT_EQ(test[0].resumes(), 1);
87 } 89 }
90
91 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/system_monitor/system_monitor_posix.cc ('k') | ui/base/system_monitor/system_monitor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698