| 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 "content/shell/test_runner/test_runner.h" | 5 #include "content/shell/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2238 bool has_rotation_rate_alpha, | 2238 bool has_rotation_rate_alpha, |
| 2239 double rotation_rate_alpha, | 2239 double rotation_rate_alpha, |
| 2240 bool has_rotation_rate_beta, | 2240 bool has_rotation_rate_beta, |
| 2241 double rotation_rate_beta, | 2241 double rotation_rate_beta, |
| 2242 bool has_rotation_rate_gamma, | 2242 bool has_rotation_rate_gamma, |
| 2243 double rotation_rate_gamma, | 2243 double rotation_rate_gamma, |
| 2244 double interval) { | 2244 double interval) { |
| 2245 device::MotionData motion; | 2245 device::MotionData motion; |
| 2246 | 2246 |
| 2247 // acceleration | 2247 // acceleration |
| 2248 motion.hasAccelerationX = has_acceleration_x; | 2248 motion.has_acceleration_x = has_acceleration_x; |
| 2249 motion.accelerationX = acceleration_x; | 2249 motion.acceleration_x = acceleration_x; |
| 2250 motion.hasAccelerationY = has_acceleration_y; | 2250 motion.has_acceleration_y = has_acceleration_y; |
| 2251 motion.accelerationY = acceleration_y; | 2251 motion.acceleration_y = acceleration_y; |
| 2252 motion.hasAccelerationZ = has_acceleration_z; | 2252 motion.has_acceleration_z = has_acceleration_z; |
| 2253 motion.accelerationZ = acceleration_z; | 2253 motion.acceleration_z = acceleration_z; |
| 2254 | 2254 |
| 2255 // accelerationIncludingGravity | 2255 // accelerationIncludingGravity |
| 2256 motion.hasAccelerationIncludingGravityX = | 2256 motion.has_acceleration_including_gravity_x = |
| 2257 has_acceleration_including_gravity_x; | 2257 has_acceleration_including_gravity_x; |
| 2258 motion.accelerationIncludingGravityX = acceleration_including_gravity_x; | 2258 motion.acceleration_including_gravity_x = acceleration_including_gravity_x; |
| 2259 motion.hasAccelerationIncludingGravityY = | 2259 motion.has_acceleration_including_gravity_y = |
| 2260 has_acceleration_including_gravity_y; | 2260 has_acceleration_including_gravity_y; |
| 2261 motion.accelerationIncludingGravityY = acceleration_including_gravity_y; | 2261 motion.acceleration_including_gravity_y = acceleration_including_gravity_y; |
| 2262 motion.hasAccelerationIncludingGravityZ = | 2262 motion.has_acceleration_including_gravity_z = |
| 2263 has_acceleration_including_gravity_z; | 2263 has_acceleration_including_gravity_z; |
| 2264 motion.accelerationIncludingGravityZ = acceleration_including_gravity_z; | 2264 motion.acceleration_including_gravity_z = acceleration_including_gravity_z; |
| 2265 | 2265 |
| 2266 // rotationRate | 2266 // rotationRate |
| 2267 motion.hasRotationRateAlpha = has_rotation_rate_alpha; | 2267 motion.has_rotation_rate_alpha = has_rotation_rate_alpha; |
| 2268 motion.rotationRateAlpha = rotation_rate_alpha; | 2268 motion.rotation_rate_alpha = rotation_rate_alpha; |
| 2269 motion.hasRotationRateBeta = has_rotation_rate_beta; | 2269 motion.has_rotation_rate_beta = has_rotation_rate_beta; |
| 2270 motion.rotationRateBeta = rotation_rate_beta; | 2270 motion.rotation_rate_beta = rotation_rate_beta; |
| 2271 motion.hasRotationRateGamma = has_rotation_rate_gamma; | 2271 motion.has_rotation_rate_gamma = has_rotation_rate_gamma; |
| 2272 motion.rotationRateGamma = rotation_rate_gamma; | 2272 motion.rotation_rate_gamma = rotation_rate_gamma; |
| 2273 | 2273 |
| 2274 // interval | 2274 // interval |
| 2275 motion.interval = interval; | 2275 motion.interval = interval; |
| 2276 | 2276 |
| 2277 delegate_->SetDeviceMotionData(motion); | 2277 delegate_->SetDeviceMotionData(motion); |
| 2278 } | 2278 } |
| 2279 | 2279 |
| 2280 void TestRunner::SetMockDeviceOrientation(bool has_alpha, | 2280 void TestRunner::SetMockDeviceOrientation(bool has_alpha, |
| 2281 double alpha, | 2281 double alpha, |
| 2282 bool has_beta, | 2282 bool has_beta, |
| 2283 double beta, | 2283 double beta, |
| 2284 bool has_gamma, | 2284 bool has_gamma, |
| 2285 double gamma, | 2285 double gamma, |
| 2286 bool absolute) { | 2286 bool absolute) { |
| 2287 device::OrientationData orientation; | 2287 device::OrientationData orientation; |
| 2288 | 2288 |
| 2289 // alpha | 2289 // alpha |
| 2290 orientation.hasAlpha = has_alpha; | 2290 orientation.has_alpha = has_alpha; |
| 2291 orientation.alpha = alpha; | 2291 orientation.alpha = alpha; |
| 2292 | 2292 |
| 2293 // beta | 2293 // beta |
| 2294 orientation.hasBeta = has_beta; | 2294 orientation.has_beta = has_beta; |
| 2295 orientation.beta = beta; | 2295 orientation.beta = beta; |
| 2296 | 2296 |
| 2297 // gamma | 2297 // gamma |
| 2298 orientation.hasGamma = has_gamma; | 2298 orientation.has_gamma = has_gamma; |
| 2299 orientation.gamma = gamma; | 2299 orientation.gamma = gamma; |
| 2300 | 2300 |
| 2301 // absolute | 2301 // absolute |
| 2302 orientation.absolute = absolute; | 2302 orientation.absolute = absolute; |
| 2303 | 2303 |
| 2304 delegate_->SetDeviceOrientationData(orientation); | 2304 delegate_->SetDeviceOrientationData(orientation); |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 MockScreenOrientationClient* TestRunner::getMockScreenOrientationClient() { | 2307 MockScreenOrientationClient* TestRunner::getMockScreenOrientationClient() { |
| 2308 return mock_screen_orientation_client_.get(); | 2308 return mock_screen_orientation_client_.get(); |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2839 | 2839 |
| 2840 void TestRunner::NotifyDone() { | 2840 void TestRunner::NotifyDone() { |
| 2841 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2841 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2842 !will_navigate_ && work_queue_.is_empty()) | 2842 !will_navigate_ && work_queue_.is_empty()) |
| 2843 delegate_->TestFinished(); | 2843 delegate_->TestFinished(); |
| 2844 layout_test_runtime_flags_.set_wait_until_done(false); | 2844 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2845 OnLayoutTestRuntimeFlagsChanged(); | 2845 OnLayoutTestRuntimeFlagsChanged(); |
| 2846 } | 2846 } |
| 2847 | 2847 |
| 2848 } // namespace test_runner | 2848 } // namespace test_runner |
| OLD | NEW |