| 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/sensors/data_fetcher_shared_memory_base.h" | 5 #include "services/device/sensors/data_fetcher_shared_memory_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
| 13 #include "device/sensors/public/cpp/device_light_hardware_buffer.h" | 13 #include "services/device/public/cpp/sensors/device_light_hardware_buffer.h" |
| 14 #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" | 14 #include "services/device/public/cpp/sensors/device_motion_hardware_buffer.h" |
| 15 #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" | 15 #include "services/device/public/cpp/sensors/device_orientation_hardware_buffer.
h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 namespace device { | 18 namespace device { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class FakeDataFetcher : public DataFetcherSharedMemoryBase { | 22 class FakeDataFetcher : public DataFetcherSharedMemoryBase { |
| 23 public: | 23 public: |
| 24 FakeDataFetcher() | 24 FakeDataFetcher() |
| 25 : start_light_(base::WaitableEvent::ResetPolicy::AUTOMATIC, | 25 : start_light_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 fake_data_fetcher.StartFetchingDeviceData(CONSUMER_TYPE_ORIENTATION)); | 600 fake_data_fetcher.StartFetchingDeviceData(CONSUMER_TYPE_ORIENTATION)); |
| 601 fake_data_fetcher.WaitForStart(CONSUMER_TYPE_ORIENTATION); | 601 fake_data_fetcher.WaitForStart(CONSUMER_TYPE_ORIENTATION); |
| 602 EXPECT_EQ(0, fake_data_fetcher.GetOrientationBuffer()->data.alpha); | 602 EXPECT_EQ(0, fake_data_fetcher.GetOrientationBuffer()->data.alpha); |
| 603 fake_data_fetcher.StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION); | 603 fake_data_fetcher.StopFetchingDeviceData(CONSUMER_TYPE_ORIENTATION); |
| 604 fake_data_fetcher.WaitForStop(CONSUMER_TYPE_ORIENTATION); | 604 fake_data_fetcher.WaitForStop(CONSUMER_TYPE_ORIENTATION); |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace | 607 } // namespace |
| 608 | 608 |
| 609 } // namespace device | 609 } // namespace device |
| OLD | NEW |