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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // expects to get an event with fake values, then removes the event | 258 // expects to get an event with fake values, then removes the event |
259 // handler and navigates to #pass. | 259 // handler and navigates to #pass. |
260 GURL test_url = GetTestUrl("device_sensors", "device_motion_test.html"); | 260 GURL test_url = GetTestUrl("device_sensors", "device_motion_test.html"); |
261 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); | 261 NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 2); |
262 | 262 |
263 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 263 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
264 fetcher_->started_motion_.Wait(); | 264 fetcher_->started_motion_.Wait(); |
265 fetcher_->stopped_motion_.Wait(); | 265 fetcher_->stopped_motion_.Wait(); |
266 } | 266 } |
267 | 267 |
| 268 // crbug/416406. The test is flaky. |
268 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, | 269 IN_PROC_BROWSER_TEST_F(DeviceInertialSensorBrowserTest, |
269 LightOneOffInfintyTest) { | 270 DISABLED_LightOneOffInfintyTest) { |
270 // The test page will register an event handler for light events, | 271 // The test page will register an event handler for light events, |
271 // expects to get an event with value equal to Infinity. This tests that the | 272 // expects to get an event with value equal to Infinity. This tests that the |
272 // one-off infinity event still propagates to window after the alert is | 273 // one-off infinity event still propagates to window after the alert is |
273 // dismissed and the callback is invoked which navigates to #pass. | 274 // dismissed and the callback is invoked which navigates to #pass. |
274 fetcher_->SetSensorDataAvailable(false); | 275 fetcher_->SetSensorDataAvailable(false); |
275 | 276 |
276 // TODO(riju): remove command line args when the feature goes stable. | 277 // TODO(riju): remove command line args when the feature goes stable. |
277 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 278 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
278 switches::kEnableExperimentalWebPlatformFeatures)) { | 279 switches::kEnableExperimentalWebPlatformFeatures)) { |
279 CommandLine::ForCurrentProcess()->AppendSwitch( | 280 CommandLine::ForCurrentProcess()->AppendSwitch( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 351 |
351 fetcher_->started_motion_.Wait(); | 352 fetcher_->started_motion_.Wait(); |
352 fetcher_->stopped_motion_.Wait(); | 353 fetcher_->stopped_motion_.Wait(); |
353 same_tab_observer.Wait(); | 354 same_tab_observer.Wait(); |
354 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 355 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
355 } | 356 } |
356 | 357 |
357 } // namespace | 358 } // namespace |
358 | 359 |
359 } // namespace content | 360 } // namespace content |
OLD | NEW |