| 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 "components/test_runner/test_runner.h" | 5 #include "components/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 13 matching lines...) Expand all Loading... |
| 24 #include "components/test_runner/mock_web_speech_recognizer.h" | 24 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 25 #include "components/test_runner/mock_web_user_media_client.h" | 25 #include "components/test_runner/mock_web_user_media_client.h" |
| 26 #include "components/test_runner/pixel_dump.h" | 26 #include "components/test_runner/pixel_dump.h" |
| 27 #include "components/test_runner/spell_check_client.h" | 27 #include "components/test_runner/spell_check_client.h" |
| 28 #include "components/test_runner/test_common.h" | 28 #include "components/test_runner/test_common.h" |
| 29 #include "components/test_runner/test_interfaces.h" | 29 #include "components/test_runner/test_interfaces.h" |
| 30 #include "components/test_runner/test_preferences.h" | 30 #include "components/test_runner/test_preferences.h" |
| 31 #include "components/test_runner/test_runner_for_specific_view.h" | 31 #include "components/test_runner/test_runner_for_specific_view.h" |
| 32 #include "components/test_runner/web_test_delegate.h" | 32 #include "components/test_runner/web_test_delegate.h" |
| 33 #include "components/test_runner/web_view_test_proxy.h" | 33 #include "components/test_runner/web_view_test_proxy.h" |
| 34 #include "device/sensors/public/cpp/motion_data.h" |
| 35 #include "device/sensors/public/cpp/orientation_data.h" |
| 34 #include "gin/arguments.h" | 36 #include "gin/arguments.h" |
| 35 #include "gin/array_buffer.h" | 37 #include "gin/array_buffer.h" |
| 36 #include "gin/handle.h" | 38 #include "gin/handle.h" |
| 37 #include "gin/object_template_builder.h" | 39 #include "gin/object_template_builder.h" |
| 38 #include "gin/wrappable.h" | 40 #include "gin/wrappable.h" |
| 39 #include "third_party/WebKit/public/platform/WebCanvas.h" | 41 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 40 #include "third_party/WebKit/public/platform/WebData.h" | 42 #include "third_party/WebKit/public/platform/WebData.h" |
| 41 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" | 43 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" |
| 42 #include "third_party/WebKit/public/platform/WebPoint.h" | 44 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 43 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 45 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 44 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | |
| 45 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | |
| 46 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistration.h" | 46 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistration.h" |
| 47 #include "third_party/WebKit/public/web/WebArrayBuffer.h" | 47 #include "third_party/WebKit/public/web/WebArrayBuffer.h" |
| 48 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" | 48 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" |
| 49 #include "third_party/WebKit/public/web/WebDataSource.h" | 49 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 50 #include "third_party/WebKit/public/web/WebDocument.h" | 50 #include "third_party/WebKit/public/web/WebDocument.h" |
| 51 #include "third_party/WebKit/public/web/WebFindOptions.h" | 51 #include "third_party/WebKit/public/web/WebFindOptions.h" |
| 52 #include "third_party/WebKit/public/web/WebFrame.h" | 52 #include "third_party/WebKit/public/web/WebFrame.h" |
| 53 #include "third_party/WebKit/public/web/WebInputElement.h" | 53 #include "third_party/WebKit/public/web/WebInputElement.h" |
| 54 #include "third_party/WebKit/public/web/WebKit.h" | 54 #include "third_party/WebKit/public/web/WebKit.h" |
| 55 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 55 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| (...skipping 2108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2164 bool has_acceleration_including_gravity_x, | 2164 bool has_acceleration_including_gravity_x, |
| 2165 double acceleration_including_gravity_x, | 2165 double acceleration_including_gravity_x, |
| 2166 bool has_acceleration_including_gravity_y, | 2166 bool has_acceleration_including_gravity_y, |
| 2167 double acceleration_including_gravity_y, | 2167 double acceleration_including_gravity_y, |
| 2168 bool has_acceleration_including_gravity_z, | 2168 bool has_acceleration_including_gravity_z, |
| 2169 double acceleration_including_gravity_z, | 2169 double acceleration_including_gravity_z, |
| 2170 bool has_rotation_rate_alpha, double rotation_rate_alpha, | 2170 bool has_rotation_rate_alpha, double rotation_rate_alpha, |
| 2171 bool has_rotation_rate_beta, double rotation_rate_beta, | 2171 bool has_rotation_rate_beta, double rotation_rate_beta, |
| 2172 bool has_rotation_rate_gamma, double rotation_rate_gamma, | 2172 bool has_rotation_rate_gamma, double rotation_rate_gamma, |
| 2173 double interval) { | 2173 double interval) { |
| 2174 WebDeviceMotionData motion; | 2174 device::MotionData motion; |
| 2175 | 2175 |
| 2176 // acceleration | 2176 // acceleration |
| 2177 motion.hasAccelerationX = has_acceleration_x; | 2177 motion.hasAccelerationX = has_acceleration_x; |
| 2178 motion.accelerationX = acceleration_x; | 2178 motion.accelerationX = acceleration_x; |
| 2179 motion.hasAccelerationY = has_acceleration_y; | 2179 motion.hasAccelerationY = has_acceleration_y; |
| 2180 motion.accelerationY = acceleration_y; | 2180 motion.accelerationY = acceleration_y; |
| 2181 motion.hasAccelerationZ = has_acceleration_z; | 2181 motion.hasAccelerationZ = has_acceleration_z; |
| 2182 motion.accelerationZ = acceleration_z; | 2182 motion.accelerationZ = acceleration_z; |
| 2183 | 2183 |
| 2184 // accelerationIncludingGravity | 2184 // accelerationIncludingGravity |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2203 // interval | 2203 // interval |
| 2204 motion.interval = interval; | 2204 motion.interval = interval; |
| 2205 | 2205 |
| 2206 delegate_->SetDeviceMotionData(motion); | 2206 delegate_->SetDeviceMotionData(motion); |
| 2207 } | 2207 } |
| 2208 | 2208 |
| 2209 void TestRunner::SetMockDeviceOrientation(bool has_alpha, double alpha, | 2209 void TestRunner::SetMockDeviceOrientation(bool has_alpha, double alpha, |
| 2210 bool has_beta, double beta, | 2210 bool has_beta, double beta, |
| 2211 bool has_gamma, double gamma, | 2211 bool has_gamma, double gamma, |
| 2212 bool absolute) { | 2212 bool absolute) { |
| 2213 WebDeviceOrientationData orientation; | 2213 device::OrientationData orientation; |
| 2214 | 2214 |
| 2215 // alpha | 2215 // alpha |
| 2216 orientation.hasAlpha = has_alpha; | 2216 orientation.hasAlpha = has_alpha; |
| 2217 orientation.alpha = alpha; | 2217 orientation.alpha = alpha; |
| 2218 | 2218 |
| 2219 // beta | 2219 // beta |
| 2220 orientation.hasBeta = has_beta; | 2220 orientation.hasBeta = has_beta; |
| 2221 orientation.beta = beta; | 2221 orientation.beta = beta; |
| 2222 | 2222 |
| 2223 // gamma | 2223 // gamma |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 | 2770 |
| 2771 void TestRunner::NotifyDone() { | 2771 void TestRunner::NotifyDone() { |
| 2772 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2772 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2773 !will_navigate_ && work_queue_.is_empty()) | 2773 !will_navigate_ && work_queue_.is_empty()) |
| 2774 delegate_->TestFinished(); | 2774 delegate_->TestFinished(); |
| 2775 layout_test_runtime_flags_.set_wait_until_done(false); | 2775 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2776 OnLayoutTestRuntimeFlagsChanged(); | 2776 OnLayoutTestRuntimeFlagsChanged(); |
| 2777 } | 2777 } |
| 2778 | 2778 |
| 2779 } // namespace test_runner | 2779 } // namespace test_runner |
| OLD | NEW |