| 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/renderer/test_runner/test_runner.h" | 5 #include "content/shell/renderer/test_runner/test_runner.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/public/test/layouttest_support.h" | 10 #include "content/public/test/layouttest_support.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void SetMockDeviceLight(double value); | 197 void SetMockDeviceLight(double value); |
| 198 void ResetDeviceLight(); | 198 void ResetDeviceLight(); |
| 199 void SetMockDeviceMotion(gin::Arguments* args); | 199 void SetMockDeviceMotion(gin::Arguments* args); |
| 200 void SetMockDeviceOrientation(gin::Arguments* args); | 200 void SetMockDeviceOrientation(gin::Arguments* args); |
| 201 void SetMockScreenOrientation(const std::string& orientation); | 201 void SetMockScreenOrientation(const std::string& orientation); |
| 202 void DidChangeBatteryStatus(bool charging, | 202 void DidChangeBatteryStatus(bool charging, |
| 203 double chargingTime, | 203 double chargingTime, |
| 204 double dischargingTime, | 204 double dischargingTime, |
| 205 double level); | 205 double level); |
| 206 void ResetBatteryStatus(); | 206 void ResetBatteryStatus(); |
| 207 void SetMockScreenAvailability(bool available); |
| 207 void DidAcquirePointerLock(); | 208 void DidAcquirePointerLock(); |
| 208 void DidNotAcquirePointerLock(); | 209 void DidNotAcquirePointerLock(); |
| 209 void DidLosePointerLock(); | 210 void DidLosePointerLock(); |
| 210 void SetPointerLockWillFailSynchronously(); | 211 void SetPointerLockWillFailSynchronously(); |
| 211 void SetPointerLockWillRespondAsynchronously(); | 212 void SetPointerLockWillRespondAsynchronously(); |
| 212 void SetPopupBlockingEnabled(bool block_popups); | 213 void SetPopupBlockingEnabled(bool block_popups); |
| 213 void SetJavaScriptCanAccessClipboard(bool can_access); | 214 void SetJavaScriptCanAccessClipboard(bool can_access); |
| 214 void SetXSSAuditorEnabled(bool enabled); | 215 void SetXSSAuditorEnabled(bool enabled); |
| 215 void SetAllowUniversalAccessFromFileURLs(bool allow); | 216 void SetAllowUniversalAccessFromFileURLs(bool allow); |
| 216 void SetAllowFileAccessFromFileURLs(bool allow); | 217 void SetAllowFileAccessFromFileURLs(bool allow); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 .SetMethod("resetDeviceLight", &TestRunnerBindings::ResetDeviceLight) | 404 .SetMethod("resetDeviceLight", &TestRunnerBindings::ResetDeviceLight) |
| 404 .SetMethod("setMockDeviceMotion", | 405 .SetMethod("setMockDeviceMotion", |
| 405 &TestRunnerBindings::SetMockDeviceMotion) | 406 &TestRunnerBindings::SetMockDeviceMotion) |
| 406 .SetMethod("setMockDeviceOrientation", | 407 .SetMethod("setMockDeviceOrientation", |
| 407 &TestRunnerBindings::SetMockDeviceOrientation) | 408 &TestRunnerBindings::SetMockDeviceOrientation) |
| 408 .SetMethod("setMockScreenOrientation", | 409 .SetMethod("setMockScreenOrientation", |
| 409 &TestRunnerBindings::SetMockScreenOrientation) | 410 &TestRunnerBindings::SetMockScreenOrientation) |
| 410 .SetMethod("didChangeBatteryStatus", | 411 .SetMethod("didChangeBatteryStatus", |
| 411 &TestRunnerBindings::DidChangeBatteryStatus) | 412 &TestRunnerBindings::DidChangeBatteryStatus) |
| 412 .SetMethod("resetBatteryStatus", &TestRunnerBindings::ResetBatteryStatus) | 413 .SetMethod("resetBatteryStatus", &TestRunnerBindings::ResetBatteryStatus) |
| 414 .SetMethod("setMockScreenAvailability", |
| 415 &TestRunnerBindings::SetMockScreenAvailability) |
| 413 .SetMethod("didAcquirePointerLock", | 416 .SetMethod("didAcquirePointerLock", |
| 414 &TestRunnerBindings::DidAcquirePointerLock) | 417 &TestRunnerBindings::DidAcquirePointerLock) |
| 415 .SetMethod("didNotAcquirePointerLock", | 418 .SetMethod("didNotAcquirePointerLock", |
| 416 &TestRunnerBindings::DidNotAcquirePointerLock) | 419 &TestRunnerBindings::DidNotAcquirePointerLock) |
| 417 .SetMethod("didLosePointerLock", &TestRunnerBindings::DidLosePointerLock) | 420 .SetMethod("didLosePointerLock", &TestRunnerBindings::DidLosePointerLock) |
| 418 .SetMethod("setPointerLockWillFailSynchronously", | 421 .SetMethod("setPointerLockWillFailSynchronously", |
| 419 &TestRunnerBindings::SetPointerLockWillFailSynchronously) | 422 &TestRunnerBindings::SetPointerLockWillFailSynchronously) |
| 420 .SetMethod("setPointerLockWillRespondAsynchronously", | 423 .SetMethod("setPointerLockWillRespondAsynchronously", |
| 421 &TestRunnerBindings::SetPointerLockWillRespondAsynchronously) | 424 &TestRunnerBindings::SetPointerLockWillRespondAsynchronously) |
| 422 .SetMethod("setPopupBlockingEnabled", | 425 .SetMethod("setPopupBlockingEnabled", |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 runner_->DidChangeBatteryStatus(charging, chargingTime, | 960 runner_->DidChangeBatteryStatus(charging, chargingTime, |
| 958 dischargingTime, level); | 961 dischargingTime, level); |
| 959 } | 962 } |
| 960 } | 963 } |
| 961 | 964 |
| 962 void TestRunnerBindings::ResetBatteryStatus() { | 965 void TestRunnerBindings::ResetBatteryStatus() { |
| 963 if (runner_) | 966 if (runner_) |
| 964 runner_->ResetBatteryStatus(); | 967 runner_->ResetBatteryStatus(); |
| 965 } | 968 } |
| 966 | 969 |
| 970 void TestRunnerBindings::SetMockScreenAvailability(bool available) { |
| 971 if (runner_) |
| 972 runner_->SetMockScreenAvailability(available); |
| 973 } |
| 974 |
| 967 void TestRunnerBindings::DidAcquirePointerLock() { | 975 void TestRunnerBindings::DidAcquirePointerLock() { |
| 968 if (runner_) | 976 if (runner_) |
| 969 runner_->DidAcquirePointerLock(); | 977 runner_->DidAcquirePointerLock(); |
| 970 } | 978 } |
| 971 | 979 |
| 972 void TestRunnerBindings::DidNotAcquirePointerLock() { | 980 void TestRunnerBindings::DidNotAcquirePointerLock() { |
| 973 if (runner_) | 981 if (runner_) |
| 974 runner_->DidNotAcquirePointerLock(); | 982 runner_->DidNotAcquirePointerLock(); |
| 975 } | 983 } |
| 976 | 984 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1625 delegate_->SetDeviceColorProfile("reset"); | 1633 delegate_->SetDeviceColorProfile("reset"); |
| 1626 delegate_->SetDeviceScaleFactor(1); | 1634 delegate_->SetDeviceScaleFactor(1); |
| 1627 delegate_->SetAcceptAllCookies(false); | 1635 delegate_->SetAcceptAllCookies(false); |
| 1628 delegate_->SetLocale(""); | 1636 delegate_->SetLocale(""); |
| 1629 delegate_->UseUnfortunateSynchronousResizeMode(false); | 1637 delegate_->UseUnfortunateSynchronousResizeMode(false); |
| 1630 delegate_->DisableAutoResizeMode(WebSize()); | 1638 delegate_->DisableAutoResizeMode(WebSize()); |
| 1631 delegate_->DeleteAllCookies(); | 1639 delegate_->DeleteAllCookies(); |
| 1632 delegate_->ResetScreenOrientation(); | 1640 delegate_->ResetScreenOrientation(); |
| 1633 delegate_->SetBluetoothMockDataSet(""); | 1641 delegate_->SetBluetoothMockDataSet(""); |
| 1634 delegate_->ClearGeofencingMockProvider(); | 1642 delegate_->ClearGeofencingMockProvider(); |
| 1643 delegate_->ResetPresentationService(); |
| 1635 ResetBatteryStatus(); | 1644 ResetBatteryStatus(); |
| 1636 ResetDeviceLight(); | 1645 ResetDeviceLight(); |
| 1637 } | 1646 } |
| 1638 | 1647 |
| 1639 dump_editting_callbacks_ = false; | 1648 dump_editting_callbacks_ = false; |
| 1640 dump_as_text_ = false; | 1649 dump_as_text_ = false; |
| 1641 dump_as_markup_ = false; | 1650 dump_as_markup_ = false; |
| 1642 generate_pixel_results_ = true; | 1651 generate_pixel_results_ = true; |
| 1643 dump_child_frame_scroll_positions_ = false; | 1652 dump_child_frame_scroll_positions_ = false; |
| 1644 dump_child_frames_as_markup_ = false; | 1653 dump_child_frames_as_markup_ = false; |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2440 status.dischargingTime = dischargingTime; | 2449 status.dischargingTime = dischargingTime; |
| 2441 status.level = level; | 2450 status.level = level; |
| 2442 delegate_->DidChangeBatteryStatus(status); | 2451 delegate_->DidChangeBatteryStatus(status); |
| 2443 } | 2452 } |
| 2444 | 2453 |
| 2445 void TestRunner::ResetBatteryStatus() { | 2454 void TestRunner::ResetBatteryStatus() { |
| 2446 blink::WebBatteryStatus status; | 2455 blink::WebBatteryStatus status; |
| 2447 delegate_->DidChangeBatteryStatus(status); | 2456 delegate_->DidChangeBatteryStatus(status); |
| 2448 } | 2457 } |
| 2449 | 2458 |
| 2459 void TestRunner::SetMockScreenAvailability(bool available) { |
| 2460 delegate_->SetScreenAvailability(available); |
| 2461 } |
| 2462 |
| 2450 void TestRunner::DidAcquirePointerLock() { | 2463 void TestRunner::DidAcquirePointerLock() { |
| 2451 DidAcquirePointerLockInternal(); | 2464 DidAcquirePointerLockInternal(); |
| 2452 } | 2465 } |
| 2453 | 2466 |
| 2454 void TestRunner::DidNotAcquirePointerLock() { | 2467 void TestRunner::DidNotAcquirePointerLock() { |
| 2455 DidNotAcquirePointerLockInternal(); | 2468 DidNotAcquirePointerLockInternal(); |
| 2456 } | 2469 } |
| 2457 | 2470 |
| 2458 void TestRunner::DidLosePointerLock() { | 2471 void TestRunner::DidLosePointerLock() { |
| 2459 DidLosePointerLockInternal(); | 2472 DidLosePointerLockInternal(); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3004 } | 3017 } |
| 3005 | 3018 |
| 3006 void TestRunner::DidLosePointerLockInternal() { | 3019 void TestRunner::DidLosePointerLockInternal() { |
| 3007 bool was_locked = pointer_locked_; | 3020 bool was_locked = pointer_locked_; |
| 3008 pointer_locked_ = false; | 3021 pointer_locked_ = false; |
| 3009 if (was_locked) | 3022 if (was_locked) |
| 3010 web_view_->didLosePointerLock(); | 3023 web_view_->didLosePointerLock(); |
| 3011 } | 3024 } |
| 3012 | 3025 |
| 3013 } // namespace content | 3026 } // namespace content |
| OLD | NEW |