Chromium Code Reviews| 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 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2559 orientation = WebScreenOrientationLandscapeSecondary; | 2558 orientation = WebScreenOrientationLandscapeSecondary; |
| 2560 } | 2559 } |
| 2561 | 2560 |
| 2562 delegate_->SetScreenOrientation(orientation); | 2561 delegate_->SetScreenOrientation(orientation); |
| 2563 } | 2562 } |
| 2564 | 2563 |
| 2565 void TestRunner::DidChangeBatteryStatus(bool charging, | 2564 void TestRunner::DidChangeBatteryStatus(bool charging, |
| 2566 double chargingTime, | 2565 double chargingTime, |
| 2567 double dischargingTime, | 2566 double dischargingTime, |
| 2568 double level) { | 2567 double level) { |
| 2569 blink::WebBatteryStatus status; | 2568 web_view_->updateBatteryStatusForTesting( |
| 2570 status.charging = charging; | 2569 charging, chargingTime, dischargingTime, level); |
|
kinuko
2016/02/16 10:09:18
Now that we have most code in blink do we need to
Yuki
2016/02/16 13:21:58
Our plan is to follow the way of http://crrev.com/
| |
| 2571 status.chargingTime = chargingTime; | |
| 2572 status.dischargingTime = dischargingTime; | |
| 2573 status.level = level; | |
| 2574 delegate_->DidChangeBatteryStatus(status); | |
| 2575 } | 2570 } |
| 2576 | 2571 |
| 2577 void TestRunner::ResetBatteryStatus() { | 2572 void TestRunner::ResetBatteryStatus() { |
| 2578 blink::WebBatteryStatus status; | 2573 web_view_->resetBatteryStatusForTesting(); |
| 2579 delegate_->DidChangeBatteryStatus(status); | |
| 2580 } | 2574 } |
| 2581 | 2575 |
| 2582 void TestRunner::DidAcquirePointerLock() { | 2576 void TestRunner::DidAcquirePointerLock() { |
| 2583 DidAcquirePointerLockInternal(); | 2577 DidAcquirePointerLockInternal(); |
| 2584 } | 2578 } |
| 2585 | 2579 |
| 2586 void TestRunner::DidNotAcquirePointerLock() { | 2580 void TestRunner::DidNotAcquirePointerLock() { |
| 2587 DidNotAcquirePointerLockInternal(); | 2581 DidNotAcquirePointerLockInternal(); |
| 2588 } | 2582 } |
| 2589 | 2583 |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3228 } | 3222 } |
| 3229 | 3223 |
| 3230 void TestRunner::DidLosePointerLockInternal() { | 3224 void TestRunner::DidLosePointerLockInternal() { |
| 3231 bool was_locked = pointer_locked_; | 3225 bool was_locked = pointer_locked_; |
| 3232 pointer_locked_ = false; | 3226 pointer_locked_ = false; |
| 3233 if (was_locked) | 3227 if (was_locked) |
| 3234 web_view_->didLosePointerLock(); | 3228 web_view_->didLosePointerLock(); |
| 3235 } | 3229 } |
| 3236 | 3230 |
| 3237 } // namespace test_runner | 3231 } // namespace test_runner |
| OLD | NEW |