| OLD | NEW |
| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "content/browser/device_orientation/data_fetcher_shared_memory.h" | 7 #include "content/browser/device_orientation/data_fetcher_shared_memory.h" |
| 8 #include "content/browser/device_orientation/device_inertial_sensor_service.h" | 8 #include "content/browser/device_orientation/device_inertial_sensor_service.h" |
| 9 #include "content/common/device_orientation/device_motion_hardware_buffer.h" | 9 #include "content/common/device_orientation/device_motion_hardware_buffer.h" |
| 10 #include "content/common/device_orientation/device_orientation_hardware_buffer.h
" | 10 #include "content/common/device_orientation/device_orientation_hardware_buffer.h
" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 io_loop_finished_event_.Signal(); | 144 io_loop_finished_event_.Signal(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 FakeDataFetcher* fetcher_; | 147 FakeDataFetcher* fetcher_; |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 base::WaitableEvent io_loop_finished_event_; | 150 base::WaitableEvent io_loop_finished_event_; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 | 153 |
| 154 // TODO(timvolodine): enable this test once the blink side has switched to | 154 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, OrientationTest) { |
| 155 // the shared memory implementation (crbug.com/298066). | |
| 156 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, | |
| 157 DISABLED_OrientationTest) { | |
| 158 // The test page will register an event handler for orientation events, | 155 // The test page will register an event handler for orientation events, |
| 159 // expects to get an event with fake values, then removes the event | 156 // expects to get an event with fake values, then removes the event |
| 160 // handler and navigates to #pass. | 157 // handler and navigates to #pass. |
| 161 GURL test_url = GetTestUrl( | 158 GURL test_url = GetTestUrl( |
| 162 "device_orientation", "device_orientation_test.html"); | 159 "device_orientation", "device_orientation_test.html"); |
| 163 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); | 160 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); |
| 164 | 161 |
| 165 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 162 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 166 fetcher_->started_orientation_.Wait(); | 163 fetcher_->started_orientation_.Wait(); |
| 167 fetcher_->stopped_orientation_.Wait(); | 164 fetcher_->stopped_orientation_.Wait(); |
| 168 } | 165 } |
| 169 | 166 |
| 170 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, MotionTest) { | 167 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, MotionTest) { |
| 171 // The test page will register an event handler for motion events, | 168 // The test page will register an event handler for motion events, |
| 172 // expects to get an event with fake values, then removes the event | 169 // expects to get an event with fake values, then removes the event |
| 173 // handler and navigates to #pass. | 170 // handler and navigates to #pass. |
| 174 GURL test_url = GetTestUrl( | 171 GURL test_url = GetTestUrl( |
| 175 "device_orientation", "device_motion_test.html"); | 172 "device_orientation", "device_motion_test.html"); |
| 176 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); | 173 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); |
| 177 | 174 |
| 178 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 175 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 179 fetcher_->started_motion_.Wait(); | 176 fetcher_->started_motion_.Wait(); |
| 180 fetcher_->stopped_motion_.Wait(); | 177 fetcher_->stopped_motion_.Wait(); |
| 181 } | 178 } |
| 182 | 179 |
| 183 } // namespace | 180 } // namespace |
| 184 | 181 |
| 185 } // namespace content | 182 } // namespace content |
| OLD | NEW |