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 "device_light_event_pump.h" | 5 #include "device_light_event_pump.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "content/common/device_sensors/device_light_hardware_buffer.h" | |
9 #include "content/public/test/test_utils.h" | 8 #include "content/public/test/test_utils.h" |
| 9 #include "device/device_sensors/device_light_hardware_buffer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" | 11 #include "third_party/WebKit/public/platform/WebDeviceLightListener.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 class MockDeviceLightListener : public blink::WebDeviceLightListener { | 15 class MockDeviceLightListener : public blink::WebDeviceLightListener { |
16 public: | 16 public: |
17 MockDeviceLightListener() : did_change_device_light_(false) {} | 17 MockDeviceLightListener() : did_change_device_light_(false) {} |
18 virtual ~MockDeviceLightListener() {} | 18 virtual ~MockDeviceLightListener() {} |
19 | 19 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 base::Bind(&DeviceLightEventPumpForTesting::FireEvent, | 151 base::Bind(&DeviceLightEventPumpForTesting::FireEvent, |
152 base::Unretained(light_pump()))); | 152 base::Unretained(light_pump()))); |
153 base::MessageLoop::current()->Run(); | 153 base::MessageLoop::current()->Run(); |
154 | 154 |
155 // No change in device light as present value is same as previous value. | 155 // No change in device light as present value is same as previous value. |
156 EXPECT_FALSE(listener()->did_change_device_light()); | 156 EXPECT_FALSE(listener()->did_change_device_light()); |
157 EXPECT_EQ(last_seen_data, static_cast<double>(received_data.value)); | 157 EXPECT_EQ(last_seen_data, static_cast<double>(received_data.value)); |
158 } | 158 } |
159 | 159 |
160 } // namespace content | 160 } // namespace content |
OLD | NEW |