| 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 "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_sensors/data_fetcher_shared_memory.h" | 8 #include "content/browser/device_sensors/data_fetcher_shared_memory.h" |
| 9 #include "content/browser/device_sensors/device_inertial_sensor_service.h" | 9 #include "content/browser/device_sensors/device_inertial_sensor_service.h" |
| 10 #include "content/common/device_sensors/device_light_hardware_buffer.h" | 10 #include "content/common/device_sensors/device_light_hardware_buffer.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 SetDataFetcherForTesting(fetcher_); | 195 SetDataFetcherForTesting(fetcher_); |
| 196 io_loop_finished_event_.Signal(); | 196 io_loop_finished_event_.Signal(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void DelayAndQuit(base::TimeDelta delay) { | 199 void DelayAndQuit(base::TimeDelta delay) { |
| 200 base::PlatformThread::Sleep(delay); | 200 base::PlatformThread::Sleep(delay); |
| 201 base::MessageLoop::current()->QuitWhenIdle(); | 201 base::MessageLoop::current()->QuitWhenIdle(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta delay) { | 204 void WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta delay) { |
| 205 ShellJavaScriptDialogManager* dialog_manager= | 205 ShellJavaScriptDialogManager* dialog_manager = |
| 206 static_cast<ShellJavaScriptDialogManager*>( | 206 static_cast<ShellJavaScriptDialogManager*>( |
| 207 shell()->GetJavaScriptDialogManager()); | 207 shell()->GetJavaScriptDialogManager(shell()->web_contents())); |
| 208 | 208 |
| 209 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); | 209 scoped_refptr<MessageLoopRunner> runner = new MessageLoopRunner(); |
| 210 dialog_manager->set_dialog_request_callback( | 210 dialog_manager->set_dialog_request_callback( |
| 211 base::Bind(&DeviceInertialSensorBrowserTest::DelayAndQuit, this, | 211 base::Bind(&DeviceInertialSensorBrowserTest::DelayAndQuit, this, |
| 212 delay)); | 212 delay)); |
| 213 runner->Run(); | 213 runner->Run(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 FakeDataFetcher* fetcher_; | 216 FakeDataFetcher* fetcher_; |
| 217 | 217 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 fetcher_->started_motion_.Wait(); | 350 fetcher_->started_motion_.Wait(); |
| 351 fetcher_->stopped_motion_.Wait(); | 351 fetcher_->stopped_motion_.Wait(); |
| 352 same_tab_observer.Wait(); | 352 same_tab_observer.Wait(); |
| 353 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 353 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace | 356 } // namespace |
| 357 | 357 |
| 358 } // namespace content | 358 } // namespace content |
| OLD | NEW |