OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/battery_status/battery_status_dispatcher.h" | 5 #include "content/renderer/battery_status/battery_status_dispatcher.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "content/public/test/mock_render_thread.h" | 8 #include "content/public/test/mock_render_thread.h" |
8 #include "content/public/test/test_utils.h" | 9 #include "content/public/test/test_utils.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" | 11 #include "third_party/WebKit/public/platform/WebBatteryStatusListener.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class MockBatteryStatusListener : public blink::WebBatteryStatusListener { | 15 class MockBatteryStatusListener : public blink::WebBatteryStatusListener { |
15 public: | 16 public: |
16 MockBatteryStatusListener() : did_change_battery_status_(false) {} | 17 MockBatteryStatusListener() : did_change_battery_status_(false) {} |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 72 |
72 const blink::WebBatteryStatus& received_status = listener().status(); | 73 const blink::WebBatteryStatus& received_status = listener().status(); |
73 EXPECT_TRUE(listener().did_change_battery_status()); | 74 EXPECT_TRUE(listener().did_change_battery_status()); |
74 EXPECT_EQ(status.charging, received_status.charging); | 75 EXPECT_EQ(status.charging, received_status.charging); |
75 EXPECT_EQ(status.charging_time, received_status.chargingTime); | 76 EXPECT_EQ(status.charging_time, received_status.chargingTime); |
76 EXPECT_EQ(status.discharging_time, received_status.dischargingTime); | 77 EXPECT_EQ(status.discharging_time, received_status.dischargingTime); |
77 EXPECT_EQ(status.level, received_status.level); | 78 EXPECT_EQ(status.level, received_status.level); |
78 } | 79 } |
79 | 80 |
80 } // namespace content | 81 } // namespace content |
OLD | NEW |