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

Side by Side Diff: content/browser/gamepad/gamepad_test_helpers.cc

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: update Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/gamepad/gamepad_test_helpers.h" 5 #include "content/browser/gamepad/gamepad_test_helpers.h"
6 6
7 #include "base/system_monitor/system_monitor.h" 7 #include "base/power_monitor/power_monitor.h"
vandebo (ex-Chrome) 2012/10/30 20:41:24 not needed
Hongbo Min 2012/10/31 12:52:50 Done.
Hongbo Min 2012/10/31 12:52:50 Done.
8 #include "content/browser/gamepad/gamepad_service.h" 8 #include "content/browser/gamepad/gamepad_service.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 MockGamepadDataFetcher::MockGamepadDataFetcher( 12 MockGamepadDataFetcher::MockGamepadDataFetcher(
13 const WebKit::WebGamepads& test_data) 13 const WebKit::WebGamepads& test_data)
14 : test_data_(test_data), 14 : test_data_(test_data),
15 read_data_(false, false) { 15 read_data_(false, false) {
16 } 16 }
17 17
(...skipping 12 matching lines...) Expand all
30 void MockGamepadDataFetcher::WaitForDataRead() { 30 void MockGamepadDataFetcher::WaitForDataRead() {
31 return read_data_.Wait(); 31 return read_data_.Wait();
32 } 32 }
33 33
34 void MockGamepadDataFetcher::SetTestData(const WebKit::WebGamepads& new_data) { 34 void MockGamepadDataFetcher::SetTestData(const WebKit::WebGamepads& new_data) {
35 base::AutoLock lock(lock_); 35 base::AutoLock lock(lock_);
36 test_data_ = new_data; 36 test_data_ = new_data;
37 } 37 }
38 38
39 GamepadTestHelper::GamepadTestHelper() { 39 GamepadTestHelper::GamepadTestHelper() {
40 #if defined(OS_MACOSX)
41 base::SystemMonitor::AllocateSystemIOPorts();
42 #endif
43 system_monitor_.reset(new base::SystemMonitor);
44 } 40 }
45 41
46 GamepadTestHelper::~GamepadTestHelper() { 42 GamepadTestHelper::~GamepadTestHelper() {
47 } 43 }
48 44
49 GamepadServiceTestConstructor::GamepadServiceTestConstructor( 45 GamepadServiceTestConstructor::GamepadServiceTestConstructor(
50 const WebKit::WebGamepads& test_data) { 46 const WebKit::WebGamepads& test_data) {
51 data_fetcher_ = new MockGamepadDataFetcher(test_data); 47 data_fetcher_ = new MockGamepadDataFetcher(test_data);
52 gamepad_service_ = 48 gamepad_service_ =
53 new GamepadService(scoped_ptr<GamepadDataFetcher>(data_fetcher_)); 49 new GamepadService(scoped_ptr<GamepadDataFetcher>(data_fetcher_));
54 } 50 }
55 51
56 GamepadServiceTestConstructor::~GamepadServiceTestConstructor() { 52 GamepadServiceTestConstructor::~GamepadServiceTestConstructor() {
57 delete gamepad_service_; 53 delete gamepad_service_;
58 } 54 }
59 55
60 } // namespace content 56 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698