| 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_motion_hardware_buffer.h" | 10 #include "content/common/device_sensors/device_motion_hardware_buffer.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 virtual void SetUpOnMainThread() OVERRIDE { | 163 virtual void SetUpOnMainThread() OVERRIDE { |
| 164 BrowserThread::PostTask( | 164 BrowserThread::PostTask( |
| 165 BrowserThread::IO, FROM_HERE, | 165 BrowserThread::IO, FROM_HERE, |
| 166 base::Bind(&DeviceInertialSensorBrowserTest::SetUpOnIOThread, this)); | 166 base::Bind(&DeviceInertialSensorBrowserTest::SetUpOnIOThread, this)); |
| 167 io_loop_finished_event_.Wait(); | 167 io_loop_finished_event_.Wait(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void SetUpOnIOThread() { | 170 void SetUpOnIOThread() { |
| 171 fetcher_ = new FakeDataFetcher(); | 171 fetcher_ = new FakeDataFetcher(); |
| 172 DeviceInertialSensorService::GetInstance()-> | 172 DeviceInertialSensorService::GetInstance()-> |
| 173 SetDataFetcherForTests(fetcher_); | 173 SetDataFetcherForTesting(fetcher_); |
| 174 io_loop_finished_event_.Signal(); | 174 io_loop_finished_event_.Signal(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void DelayAndQuit(base::TimeDelta delay) { | 177 void DelayAndQuit(base::TimeDelta delay) { |
| 178 base::PlatformThread::Sleep(delay); | 178 base::PlatformThread::Sleep(delay); |
| 179 base::MessageLoop::current()->QuitWhenIdle(); | 179 base::MessageLoop::current()->QuitWhenIdle(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta delay) { | 182 void WaitForAlertDialogAndQuitAfterDelay(base::TimeDelta delay) { |
| 183 ShellJavaScriptDialogManager* dialog_manager= | 183 ShellJavaScriptDialogManager* dialog_manager= |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 fetcher_->started_motion_.Wait(); | 281 fetcher_->started_motion_.Wait(); |
| 282 fetcher_->stopped_motion_.Wait(); | 282 fetcher_->stopped_motion_.Wait(); |
| 283 same_tab_observer.Wait(); | 283 same_tab_observer.Wait(); |
| 284 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 284 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace | 287 } // namespace |
| 288 | 288 |
| 289 } // namespace content | 289 } // namespace content |
| OLD | NEW |