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