| 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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "components/test_runner/mock_credential_manager_client.h" | 17 #include "components/test_runner/mock_credential_manager_client.h" |
| 18 #include "components/test_runner/mock_web_speech_recognizer.h" | 18 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 19 #include "components/test_runner/test_interfaces.h" | 19 #include "components/test_runner/test_interfaces.h" |
| 20 #include "components/test_runner/test_preferences.h" | 20 #include "components/test_runner/test_preferences.h" |
| 21 #include "components/test_runner/web_content_settings.h" | 21 #include "components/test_runner/web_content_settings.h" |
| 22 #include "components/test_runner/web_test_delegate.h" | 22 #include "components/test_runner/web_test_delegate.h" |
| 23 #include "components/test_runner/web_test_proxy.h" | 23 #include "components/test_runner/web_test_proxy.h" |
| 24 #include "gin/arguments.h" | 24 #include "gin/arguments.h" |
| 25 #include "gin/array_buffer.h" | 25 #include "gin/array_buffer.h" |
| 26 #include "gin/handle.h" | 26 #include "gin/handle.h" |
| 27 #include "gin/object_template_builder.h" | 27 #include "gin/object_template_builder.h" |
| 28 #include "gin/wrappable.h" | 28 #include "gin/wrappable.h" |
| 29 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" | |
| 30 #include "third_party/WebKit/public/platform/WebCanvas.h" | 29 #include "third_party/WebKit/public/platform/WebCanvas.h" |
| 31 #include "third_party/WebKit/public/platform/WebData.h" | 30 #include "third_party/WebKit/public/platform/WebData.h" |
| 32 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" | 31 #include "third_party/WebKit/public/platform/WebPasswordCredential.h" |
| 33 #include "third_party/WebKit/public/platform/WebPoint.h" | 32 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 34 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 33 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 35 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" | 34 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eMotionData.h" |
| 36 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" | 35 #include "third_party/WebKit/public/platform/modules/device_orientation/WebDevic
eOrientationData.h" |
| 37 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistration.h" | 36 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistration.h" |
| 38 #include "third_party/WebKit/public/web/WebArrayBuffer.h" | 37 #include "third_party/WebKit/public/web/WebArrayBuffer.h" |
| 39 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" | 38 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" |
| (...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2524 orientation = WebScreenOrientationLandscapeSecondary; | 2523 orientation = WebScreenOrientationLandscapeSecondary; |
| 2525 } | 2524 } |
| 2526 | 2525 |
| 2527 delegate_->SetScreenOrientation(orientation); | 2526 delegate_->SetScreenOrientation(orientation); |
| 2528 } | 2527 } |
| 2529 | 2528 |
| 2530 void TestRunner::DidChangeBatteryStatus(bool charging, | 2529 void TestRunner::DidChangeBatteryStatus(bool charging, |
| 2531 double chargingTime, | 2530 double chargingTime, |
| 2532 double dischargingTime, | 2531 double dischargingTime, |
| 2533 double level) { | 2532 double level) { |
| 2534 blink::WebBatteryStatus status; | 2533 web_view_->updateBatteryStatusForTesting( |
| 2535 status.charging = charging; | 2534 charging, chargingTime, dischargingTime, level); |
| 2536 status.chargingTime = chargingTime; | |
| 2537 status.dischargingTime = dischargingTime; | |
| 2538 status.level = level; | |
| 2539 delegate_->DidChangeBatteryStatus(status); | |
| 2540 } | 2535 } |
| 2541 | 2536 |
| 2542 void TestRunner::ResetBatteryStatus() { | 2537 void TestRunner::ResetBatteryStatus() { |
| 2543 blink::WebBatteryStatus status; | 2538 web_view_->resetBatteryStatusForTesting(); |
| 2544 delegate_->DidChangeBatteryStatus(status); | |
| 2545 } | 2539 } |
| 2546 | 2540 |
| 2547 void TestRunner::DidAcquirePointerLock() { | 2541 void TestRunner::DidAcquirePointerLock() { |
| 2548 DidAcquirePointerLockInternal(); | 2542 DidAcquirePointerLockInternal(); |
| 2549 } | 2543 } |
| 2550 | 2544 |
| 2551 void TestRunner::DidNotAcquirePointerLock() { | 2545 void TestRunner::DidNotAcquirePointerLock() { |
| 2552 DidNotAcquirePointerLockInternal(); | 2546 DidNotAcquirePointerLockInternal(); |
| 2553 } | 2547 } |
| 2554 | 2548 |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3188 } | 3182 } |
| 3189 | 3183 |
| 3190 void TestRunner::DidLosePointerLockInternal() { | 3184 void TestRunner::DidLosePointerLockInternal() { |
| 3191 bool was_locked = pointer_locked_; | 3185 bool was_locked = pointer_locked_; |
| 3192 pointer_locked_ = false; | 3186 pointer_locked_ = false; |
| 3193 if (was_locked) | 3187 if (was_locked) |
| 3194 web_view_->didLosePointerLock(); | 3188 web_view_->didLosePointerLock(); |
| 3195 } | 3189 } |
| 3196 | 3190 |
| 3197 } // namespace test_runner | 3191 } // namespace test_runner |
| OLD | NEW |