| 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/app_banner_client.h" | 17 #include "components/test_runner/app_banner_client.h" |
| 18 #include "components/test_runner/layout_and_paint_async_then.h" | 18 #include "components/test_runner/composite_async_then.h" |
| 19 #include "components/test_runner/layout_dump.h" | 19 #include "components/test_runner/layout_dump.h" |
| 20 #include "components/test_runner/mock_content_settings_client.h" | 20 #include "components/test_runner/mock_content_settings_client.h" |
| 21 #include "components/test_runner/mock_credential_manager_client.h" | 21 #include "components/test_runner/mock_credential_manager_client.h" |
| 22 #include "components/test_runner/mock_screen_orientation_client.h" | 22 #include "components/test_runner/mock_screen_orientation_client.h" |
| 23 #include "components/test_runner/mock_web_speech_recognizer.h" | 23 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 24 #include "components/test_runner/mock_web_user_media_client.h" | 24 #include "components/test_runner/mock_web_user_media_client.h" |
| 25 #include "components/test_runner/pixel_dump.h" | 25 #include "components/test_runner/pixel_dump.h" |
| 26 #include "components/test_runner/spell_check_client.h" | 26 #include "components/test_runner/spell_check_client.h" |
| 27 #include "components/test_runner/test_common.h" | 27 #include "components/test_runner/test_common.h" |
| 28 #include "components/test_runner/test_interfaces.h" | 28 #include "components/test_runner/test_interfaces.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 double confidence); | 114 double confidence); |
| 115 void AddOriginAccessWhitelistEntry(const std::string& source_origin, | 115 void AddOriginAccessWhitelistEntry(const std::string& source_origin, |
| 116 const std::string& destination_protocol, | 116 const std::string& destination_protocol, |
| 117 const std::string& destination_host, | 117 const std::string& destination_host, |
| 118 bool allow_destination_subdomains); | 118 bool allow_destination_subdomains); |
| 119 void AddWebPageOverlay(); | 119 void AddWebPageOverlay(); |
| 120 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); | 120 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); |
| 121 void ClearAllDatabases(); | 121 void ClearAllDatabases(); |
| 122 void ClearPrinting(); | 122 void ClearPrinting(); |
| 123 void CloseWebInspector(); | 123 void CloseWebInspector(); |
| 124 void CompositeAsyncThen(v8::Local<v8::Function> callback); |
| 124 void CopyImageAtAndCapturePixelsAsyncThen(int x, | 125 void CopyImageAtAndCapturePixelsAsyncThen(int x, |
| 125 int y, | 126 int y, |
| 126 v8::Local<v8::Function> callback); | 127 v8::Local<v8::Function> callback); |
| 127 void DidAcquirePointerLock(); | 128 void DidAcquirePointerLock(); |
| 128 void DidLosePointerLock(); | 129 void DidLosePointerLock(); |
| 129 void DidNotAcquirePointerLock(); | 130 void DidNotAcquirePointerLock(); |
| 130 void DisableMockScreenOrientation(); | 131 void DisableMockScreenOrientation(); |
| 131 void DispatchBeforeInstallPromptEvent( | 132 void DispatchBeforeInstallPromptEvent( |
| 132 int request_id, | 133 int request_id, |
| 133 const std::vector<std::string>& event_platforms, | 134 const std::vector<std::string>& event_platforms, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 159 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); | 160 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); |
| 160 void EvaluateInWebInspector(int call_id, const std::string& script); | 161 void EvaluateInWebInspector(int call_id, const std::string& script); |
| 161 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); | 162 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); |
| 162 void ExecCommand(gin::Arguments* args); | 163 void ExecCommand(gin::Arguments* args); |
| 163 void ForceNextDrawingBufferCreationToFail(); | 164 void ForceNextDrawingBufferCreationToFail(); |
| 164 void ForceNextWebGLContextCreationToFail(); | 165 void ForceNextWebGLContextCreationToFail(); |
| 165 void ForceRedSelectionColors(); | 166 void ForceRedSelectionColors(); |
| 166 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); | 167 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); |
| 167 void GetManifestThen(v8::Local<v8::Function> callback); | 168 void GetManifestThen(v8::Local<v8::Function> callback); |
| 168 void InsertStyleSheet(const std::string& source_code); | 169 void InsertStyleSheet(const std::string& source_code); |
| 169 void LayoutAndPaintAsync(); | |
| 170 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback); | |
| 171 void LogToStderr(const std::string& output); | 170 void LogToStderr(const std::string& output); |
| 172 void NotImplemented(const gin::Arguments& args); | 171 void NotImplemented(const gin::Arguments& args); |
| 173 void NotifyDone(); | 172 void NotifyDone(); |
| 174 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); | 173 void OverridePreference(const std::string& key, v8::Local<v8::Value> value); |
| 175 void QueueBackNavigation(int how_far_back); | 174 void QueueBackNavigation(int how_far_back); |
| 176 void QueueForwardNavigation(int how_far_forward); | 175 void QueueForwardNavigation(int how_far_forward); |
| 177 void QueueLoad(gin::Arguments* args); | 176 void QueueLoad(gin::Arguments* args); |
| 178 void QueueLoadingScript(const std::string& script); | 177 void QueueLoadingScript(const std::string& script); |
| 179 void QueueNonLoadingScript(const std::string& script); | 178 void QueueNonLoadingScript(const std::string& script); |
| 180 void QueueReload(); | 179 void QueueReload(); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 .SetMethod("addWebPageOverlay", &TestRunnerBindings::AddWebPageOverlay) | 344 .SetMethod("addWebPageOverlay", &TestRunnerBindings::AddWebPageOverlay) |
| 346 .SetMethod("animationScheduled", &TestRunnerBindings::AnimationScheduled) | 345 .SetMethod("animationScheduled", &TestRunnerBindings::AnimationScheduled) |
| 347 .SetMethod("callShouldCloseOnWebView", | 346 .SetMethod("callShouldCloseOnWebView", |
| 348 &TestRunnerBindings::CallShouldCloseOnWebView) | 347 &TestRunnerBindings::CallShouldCloseOnWebView) |
| 349 .SetMethod("capturePixelsAsyncThen", | 348 .SetMethod("capturePixelsAsyncThen", |
| 350 &TestRunnerBindings::CapturePixelsAsyncThen) | 349 &TestRunnerBindings::CapturePixelsAsyncThen) |
| 351 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases) | 350 .SetMethod("clearAllDatabases", &TestRunnerBindings::ClearAllDatabases) |
| 352 .SetMethod("clearBackForwardList", &TestRunnerBindings::NotImplemented) | 351 .SetMethod("clearBackForwardList", &TestRunnerBindings::NotImplemented) |
| 353 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) | 352 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) |
| 354 .SetMethod("closeWebInspector", &TestRunnerBindings::CloseWebInspector) | 353 .SetMethod("closeWebInspector", &TestRunnerBindings::CloseWebInspector) |
| 354 .SetMethod("compositeAsyncThen", |
| 355 &TestRunnerBindings::CompositeAsyncThen) |
| 356 .SetMethod("layoutAndPaintAsyncThen", |
| 357 &TestRunnerBindings::CompositeAsyncThen) |
| 355 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", | 358 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", |
| 356 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) | 359 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) |
| 357 .SetMethod("didAcquirePointerLock", | 360 .SetMethod("didAcquirePointerLock", |
| 358 &TestRunnerBindings::DidAcquirePointerLock) | 361 &TestRunnerBindings::DidAcquirePointerLock) |
| 359 .SetMethod("didLosePointerLock", &TestRunnerBindings::DidLosePointerLock) | 362 .SetMethod("didLosePointerLock", &TestRunnerBindings::DidLosePointerLock) |
| 360 .SetMethod("didNotAcquirePointerLock", | 363 .SetMethod("didNotAcquirePointerLock", |
| 361 &TestRunnerBindings::DidNotAcquirePointerLock) | 364 &TestRunnerBindings::DidNotAcquirePointerLock) |
| 362 .SetMethod("disableAutoResizeMode", | 365 .SetMethod("disableAutoResizeMode", |
| 363 &TestRunnerBindings::DisableAutoResizeMode) | 366 &TestRunnerBindings::DisableAutoResizeMode) |
| 364 .SetMethod("disableMockScreenOrientation", | 367 .SetMethod("disableMockScreenOrientation", |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 // https://webbluetoothcg.github.io/web-bluetooth/tests/. | 438 // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
| 436 .SetMethod("getBluetoothManualChooserEvents", | 439 .SetMethod("getBluetoothManualChooserEvents", |
| 437 &TestRunnerBindings::GetBluetoothManualChooserEvents) | 440 &TestRunnerBindings::GetBluetoothManualChooserEvents) |
| 438 .SetMethod("getManifestThen", &TestRunnerBindings::GetManifestThen) | 441 .SetMethod("getManifestThen", &TestRunnerBindings::GetManifestThen) |
| 439 .SetMethod("hasCustomPageSizeStyle", | 442 .SetMethod("hasCustomPageSizeStyle", |
| 440 &TestRunnerBindings::HasCustomPageSizeStyle) | 443 &TestRunnerBindings::HasCustomPageSizeStyle) |
| 441 .SetMethod("insertStyleSheet", &TestRunnerBindings::InsertStyleSheet) | 444 .SetMethod("insertStyleSheet", &TestRunnerBindings::InsertStyleSheet) |
| 442 .SetMethod("isChooserShown", &TestRunnerBindings::IsChooserShown) | 445 .SetMethod("isChooserShown", &TestRunnerBindings::IsChooserShown) |
| 443 .SetMethod("isCommandEnabled", &TestRunnerBindings::IsCommandEnabled) | 446 .SetMethod("isCommandEnabled", &TestRunnerBindings::IsCommandEnabled) |
| 444 .SetMethod("keepWebHistory", &TestRunnerBindings::NotImplemented) | 447 .SetMethod("keepWebHistory", &TestRunnerBindings::NotImplemented) |
| 445 .SetMethod("layoutAndPaintAsync", | |
| 446 &TestRunnerBindings::LayoutAndPaintAsync) | |
| 447 .SetMethod("layoutAndPaintAsyncThen", | |
| 448 &TestRunnerBindings::LayoutAndPaintAsyncThen) | |
| 449 .SetMethod("logToStderr", &TestRunnerBindings::LogToStderr) | 448 .SetMethod("logToStderr", &TestRunnerBindings::LogToStderr) |
| 450 .SetMethod("notifyDone", &TestRunnerBindings::NotifyDone) | 449 .SetMethod("notifyDone", &TestRunnerBindings::NotifyDone) |
| 451 .SetMethod("overridePreference", &TestRunnerBindings::OverridePreference) | 450 .SetMethod("overridePreference", &TestRunnerBindings::OverridePreference) |
| 452 .SetMethod("pathToLocalResource", | 451 .SetMethod("pathToLocalResource", |
| 453 &TestRunnerBindings::PathToLocalResource) | 452 &TestRunnerBindings::PathToLocalResource) |
| 454 .SetProperty("platformName", &TestRunnerBindings::PlatformName) | 453 .SetProperty("platformName", &TestRunnerBindings::PlatformName) |
| 455 .SetMethod("queueBackNavigation", | 454 .SetMethod("queueBackNavigation", |
| 456 &TestRunnerBindings::QueueBackNavigation) | 455 &TestRunnerBindings::QueueBackNavigation) |
| 457 .SetMethod("queueForwardNavigation", | 456 .SetMethod("queueForwardNavigation", |
| 458 &TestRunnerBindings::QueueForwardNavigation) | 457 &TestRunnerBindings::QueueForwardNavigation) |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 void TestRunnerBindings::AddWebPageOverlay() { | 1367 void TestRunnerBindings::AddWebPageOverlay() { |
| 1369 if (view_runner_) | 1368 if (view_runner_) |
| 1370 view_runner_->AddWebPageOverlay(); | 1369 view_runner_->AddWebPageOverlay(); |
| 1371 } | 1370 } |
| 1372 | 1371 |
| 1373 void TestRunnerBindings::RemoveWebPageOverlay() { | 1372 void TestRunnerBindings::RemoveWebPageOverlay() { |
| 1374 if (view_runner_) | 1373 if (view_runner_) |
| 1375 view_runner_->RemoveWebPageOverlay(); | 1374 view_runner_->RemoveWebPageOverlay(); |
| 1376 } | 1375 } |
| 1377 | 1376 |
| 1378 void TestRunnerBindings::LayoutAndPaintAsync() { | 1377 void TestRunnerBindings::CompositeAsyncThen(v8::Local<v8::Function> callback) { |
| 1379 if (view_runner_) | 1378 if (view_runner_) |
| 1380 view_runner_->LayoutAndPaintAsync(); | 1379 view_runner_->CompositeAsyncThen(callback); |
| 1381 } | |
| 1382 | |
| 1383 void TestRunnerBindings::LayoutAndPaintAsyncThen( | |
| 1384 v8::Local<v8::Function> callback) { | |
| 1385 if (view_runner_) | |
| 1386 view_runner_->LayoutAndPaintAsyncThen(callback); | |
| 1387 } | 1380 } |
| 1388 | 1381 |
| 1389 void TestRunnerBindings::GetManifestThen(v8::Local<v8::Function> callback) { | 1382 void TestRunnerBindings::GetManifestThen(v8::Local<v8::Function> callback) { |
| 1390 if (view_runner_) | 1383 if (view_runner_) |
| 1391 view_runner_->GetManifestThen(callback); | 1384 view_runner_->GetManifestThen(callback); |
| 1392 } | 1385 } |
| 1393 | 1386 |
| 1394 void TestRunnerBindings::CapturePixelsAsyncThen( | 1387 void TestRunnerBindings::CapturePixelsAsyncThen( |
| 1395 v8::Local<v8::Function> callback) { | 1388 v8::Local<v8::Function> callback) { |
| 1396 if (view_runner_) | 1389 if (view_runner_) |
| (...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 | 2711 |
| 2719 void TestRunner::NotifyDone() { | 2712 void TestRunner::NotifyDone() { |
| 2720 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2713 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2721 work_queue_.is_empty()) | 2714 work_queue_.is_empty()) |
| 2722 delegate_->TestFinished(); | 2715 delegate_->TestFinished(); |
| 2723 layout_test_runtime_flags_.set_wait_until_done(false); | 2716 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2724 OnLayoutTestRuntimeFlagsChanged(); | 2717 OnLayoutTestRuntimeFlagsChanged(); |
| 2725 } | 2718 } |
| 2726 | 2719 |
| 2727 } // namespace test_runner | 2720 } // namespace test_runner |
| OLD | NEW |