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

Side by Side Diff: services/device/power_monitor/power_monitor_message_broadcaster_unittest.cc

Issue 2678373003: [DeviceService] Move PowerMonitor interfaces, client lib, impl to live in Device Service (Closed)
Patch Set: Created 3 years, 10 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
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 "services/device/power_monitor/power_monitor_message_broadcaster.h"
6
5 #include "base/macros.h" 7 #include "base/macros.h"
6 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
7 #include "base/run_loop.h" 9 #include "base/run_loop.h"
8 #include "base/test/power_monitor_test_base.h" 10 #include "base/test/power_monitor_test_base.h"
9 #include "device/power_monitor/power_monitor_message_broadcaster.h"
10 #include "mojo/public/cpp/bindings/binding.h" 11 #include "mojo/public/cpp/bindings/binding.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 namespace device { 14 namespace device {
14 15
15 class FakePowerMonitorClient : public device::mojom::PowerMonitorClient { 16 class FakePowerMonitorClient : public device::mojom::PowerMonitorClient {
16 public: 17 public:
17 FakePowerMonitorClient(device::mojom::PowerMonitorClientRequest request) 18 FakePowerMonitorClient(device::mojom::PowerMonitorClientRequest request)
18 : binding_(this, std::move(request)), 19 : binding_(this, std::move(request)),
19 power_state_changes_(0), 20 power_state_changes_(0),
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Pretend the device has gone off battery power 103 // Pretend the device has gone off battery power
103 source()->GeneratePowerStateEvent(false); 104 source()->GeneratePowerStateEvent(false);
104 EXPECT_EQ(client.power_state_changes(), 3); 105 EXPECT_EQ(client.power_state_changes(), 3);
105 106
106 // Repeated indications the device is off battery power should be suppressed. 107 // Repeated indications the device is off battery power should be suppressed.
107 source()->GeneratePowerStateEvent(false); 108 source()->GeneratePowerStateEvent(false);
108 EXPECT_EQ(client.power_state_changes(), 3); 109 EXPECT_EQ(client.power_state_changes(), 3);
109 } 110 }
110 111
111 } // namespace device 112 } // namespace device
OLDNEW
« no previous file with comments | « services/device/power_monitor/power_monitor_message_broadcaster.cc ('k') | services/device/public/cpp/power_monitor/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698