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 "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
8 #include "content/browser/device_orientation/data_fetcher_shared_memory.h" | 8 #include "content/browser/device_sensors/data_fetcher_shared_memory.h" |
9 #include "content/browser/device_orientation/device_inertial_sensor_service.h" | 9 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
10 #include "content/common/device_orientation/device_motion_hardware_buffer.h" | 10 #include "content/common/device_sensors/device_motion_hardware_buffer.h" |
11 #include "content/common/device_orientation/device_orientation_hardware_buffer.h
" | 11 #include "content/common/device_sensors/device_orientation_hardware_buffer.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
15 #include "content/public/test/content_browser_test.h" | 15 #include "content/public/test/content_browser_test.h" |
16 #include "content/public/test/content_browser_test_utils.h" | 16 #include "content/public/test/content_browser_test_utils.h" |
17 #include "content/public/test/test_navigation_observer.h" | 17 #include "content/public/test/test_navigation_observer.h" |
18 #include "content/public/test/test_utils.h" | 18 #include "content/public/test/test_utils.h" |
19 #include "content/shell/browser/shell.h" | 19 #include "content/shell/browser/shell.h" |
20 #include "content/shell/browser/shell_javascript_dialog_manager.h" | 20 #include "content/shell/browser/shell_javascript_dialog_manager.h" |
21 | 21 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 buffer->seqlock.WriteEnd(); | 142 buffer->seqlock.WriteEnd(); |
143 } | 143 } |
144 | 144 |
145 base::WaitableEvent started_orientation_; | 145 base::WaitableEvent started_orientation_; |
146 base::WaitableEvent stopped_orientation_; | 146 base::WaitableEvent stopped_orientation_; |
147 base::WaitableEvent started_motion_; | 147 base::WaitableEvent started_motion_; |
148 base::WaitableEvent stopped_motion_; | 148 base::WaitableEvent stopped_motion_; |
149 bool sensor_data_available_; | 149 bool sensor_data_available_; |
150 | 150 |
151 private: | 151 private: |
152 | |
153 DISALLOW_COPY_AND_ASSIGN(FakeDataFetcher); | 152 DISALLOW_COPY_AND_ASSIGN(FakeDataFetcher); |
154 }; | 153 }; |
155 | 154 |
156 | 155 |
157 class DeviceInertialSensorBrowserTest : public ContentBrowserTest { | 156 class DeviceInertialSensorBrowserTest : public ContentBrowserTest { |
158 public: | 157 public: |
159 DeviceInertialSensorBrowserTest() | 158 DeviceInertialSensorBrowserTest() |
160 : fetcher_(NULL), | 159 : fetcher_(NULL), |
161 io_loop_finished_event_(false, false) { | 160 io_loop_finished_event_(false, false) { |
162 } | 161 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 // TODO(timvolodine): investigate if it is possible to test this without | 277 // TODO(timvolodine): investigate if it is possible to test this without |
279 // delay, crbug.com/360044. | 278 // delay, crbug.com/360044. |
280 WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta::FromMilliseconds(1000)); | 279 WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta::FromMilliseconds(1000)); |
281 | 280 |
282 fetcher_->started_motion_.Wait(); | 281 fetcher_->started_motion_.Wait(); |
283 fetcher_->stopped_motion_.Wait(); | 282 fetcher_->stopped_motion_.Wait(); |
284 same_tab_observer.Wait(); | 283 same_tab_observer.Wait(); |
285 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 284 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
286 } | 285 } |
287 | 286 |
288 } // namespace | 287 } // namespace |
289 | 288 |
290 } // namespace content | 289 } // namespace content |
OLD | NEW |