| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 void SetAllowFileAccessFromFileURLs(bool allow); | 193 void SetAllowFileAccessFromFileURLs(bool allow); |
| 194 void SetAllowRunningOfInsecureContent(bool allowed); | 194 void SetAllowRunningOfInsecureContent(bool allowed); |
| 195 void SetAutoplayAllowed(bool allowed); | 195 void SetAutoplayAllowed(bool allowed); |
| 196 void SetAllowUniversalAccessFromFileURLs(bool allow); | 196 void SetAllowUniversalAccessFromFileURLs(bool allow); |
| 197 void SetBlockThirdPartyCookies(bool block); | 197 void SetBlockThirdPartyCookies(bool block); |
| 198 void SetAudioData(const gin::ArrayBufferView& view); | 198 void SetAudioData(const gin::ArrayBufferView& view); |
| 199 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); | 199 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); |
| 200 void SetBluetoothFakeAdapter(const std::string& adapter_name, | 200 void SetBluetoothFakeAdapter(const std::string& adapter_name, |
| 201 v8::Local<v8::Function> callback); | 201 v8::Local<v8::Function> callback); |
| 202 void SetBluetoothManualChooser(bool enable); | 202 void SetBluetoothManualChooser(bool enable); |
| 203 |
| 204 void GetAllPaymentAppIDs(v8::Local<v8::Function> callback); |
| 205 void InvokePaymentApp(int64_t registration_id); |
| 206 |
| 203 void SetCanOpenWindows(); | 207 void SetCanOpenWindows(); |
| 204 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args); | 208 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args); |
| 205 void SetColorProfile(const std::string& name, | 209 void SetColorProfile(const std::string& name, |
| 206 v8::Local<v8::Function> callback); | 210 v8::Local<v8::Function> callback); |
| 207 void SetCustomPolicyDelegate(gin::Arguments* args); | 211 void SetCustomPolicyDelegate(gin::Arguments* args); |
| 208 void SetCustomTextOutput(const std::string& output); | 212 void SetCustomTextOutput(const std::string& output); |
| 209 void SetDatabaseQuota(int quota); | 213 void SetDatabaseQuota(int quota); |
| 210 void SetDisallowedSubresourcePathSuffixes( | 214 void SetDisallowedSubresourcePathSuffixes( |
| 211 const std::vector<std::string>& suffixes); | 215 const std::vector<std::string>& suffixes); |
| 212 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden, | 216 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden, |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 &TestRunnerBindings::SetBlockThirdPartyCookies) | 503 &TestRunnerBindings::SetBlockThirdPartyCookies) |
| 500 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) | 504 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) |
| 501 .SetMethod("setBackingScaleFactor", | 505 .SetMethod("setBackingScaleFactor", |
| 502 &TestRunnerBindings::SetBackingScaleFactor) | 506 &TestRunnerBindings::SetBackingScaleFactor) |
| 503 // The Bluetooth functions are specified at | 507 // The Bluetooth functions are specified at |
| 504 // https://webbluetoothcg.github.io/web-bluetooth/tests/. | 508 // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
| 505 .SetMethod("setBluetoothFakeAdapter", | 509 .SetMethod("setBluetoothFakeAdapter", |
| 506 &TestRunnerBindings::SetBluetoothFakeAdapter) | 510 &TestRunnerBindings::SetBluetoothFakeAdapter) |
| 507 .SetMethod("setBluetoothManualChooser", | 511 .SetMethod("setBluetoothManualChooser", |
| 508 &TestRunnerBindings::SetBluetoothManualChooser) | 512 &TestRunnerBindings::SetBluetoothManualChooser) |
| 513 .SetMethod("getAllPaymentAppIDs", |
| 514 &TestRunnerBindings::GetAllPaymentAppIDs) |
| 515 .SetMethod("invokePaymentApp", &TestRunnerBindings::InvokePaymentApp) |
| 509 .SetMethod("setCallCloseOnWebViews", &TestRunnerBindings::NotImplemented) | 516 .SetMethod("setCallCloseOnWebViews", &TestRunnerBindings::NotImplemented) |
| 510 .SetMethod("setCanOpenWindows", &TestRunnerBindings::SetCanOpenWindows) | 517 .SetMethod("setCanOpenWindows", &TestRunnerBindings::SetCanOpenWindows) |
| 511 .SetMethod("setCloseRemainingWindowsWhenComplete", | 518 .SetMethod("setCloseRemainingWindowsWhenComplete", |
| 512 &TestRunnerBindings::SetCloseRemainingWindowsWhenComplete) | 519 &TestRunnerBindings::SetCloseRemainingWindowsWhenComplete) |
| 513 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) | 520 .SetMethod("setColorProfile", &TestRunnerBindings::SetColorProfile) |
| 514 .SetMethod("setCustomPolicyDelegate", | 521 .SetMethod("setCustomPolicyDelegate", |
| 515 &TestRunnerBindings::SetCustomPolicyDelegate) | 522 &TestRunnerBindings::SetCustomPolicyDelegate) |
| 516 .SetMethod("setCustomTextOutput", | 523 .SetMethod("setCustomTextOutput", |
| 517 &TestRunnerBindings::SetCustomTextOutput) | 524 &TestRunnerBindings::SetCustomTextOutput) |
| 518 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota) | 525 .SetMethod("setDatabaseQuota", &TestRunnerBindings::SetDatabaseQuota) |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 v8::Local<v8::Function> callback) { | 1350 v8::Local<v8::Function> callback) { |
| 1344 if (view_runner_) | 1351 if (view_runner_) |
| 1345 view_runner_->SetBluetoothFakeAdapter(adapter_name, callback); | 1352 view_runner_->SetBluetoothFakeAdapter(adapter_name, callback); |
| 1346 } | 1353 } |
| 1347 | 1354 |
| 1348 void TestRunnerBindings::SetBluetoothManualChooser(bool enable) { | 1355 void TestRunnerBindings::SetBluetoothManualChooser(bool enable) { |
| 1349 if (view_runner_) | 1356 if (view_runner_) |
| 1350 view_runner_->SetBluetoothManualChooser(enable); | 1357 view_runner_->SetBluetoothManualChooser(enable); |
| 1351 } | 1358 } |
| 1352 | 1359 |
| 1360 void TestRunnerBindings::GetAllPaymentAppIDs(v8::Local<v8::Function> callback) { |
| 1361 if (view_runner_) |
| 1362 view_runner_->GetAllPaymentAppIDs(callback); |
| 1363 } |
| 1364 |
| 1365 void TestRunnerBindings::InvokePaymentApp(int64_t registration_id) { |
| 1366 if (view_runner_) |
| 1367 view_runner_->InvokePaymentApp(registration_id); |
| 1368 } |
| 1369 |
| 1353 void TestRunnerBindings::GetBluetoothManualChooserEvents( | 1370 void TestRunnerBindings::GetBluetoothManualChooserEvents( |
| 1354 v8::Local<v8::Function> callback) { | 1371 v8::Local<v8::Function> callback) { |
| 1355 if (view_runner_) | 1372 if (view_runner_) |
| 1356 return view_runner_->GetBluetoothManualChooserEvents(callback); | 1373 return view_runner_->GetBluetoothManualChooserEvents(callback); |
| 1357 } | 1374 } |
| 1358 | 1375 |
| 1359 void TestRunnerBindings::SendBluetoothManualChooserEvent( | 1376 void TestRunnerBindings::SendBluetoothManualChooserEvent( |
| 1360 const std::string& event, | 1377 const std::string& event, |
| 1361 const std::string& argument) { | 1378 const std::string& argument) { |
| 1362 if (view_runner_) | 1379 if (view_runner_) |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 | 2830 |
| 2814 void TestRunner::NotifyDone() { | 2831 void TestRunner::NotifyDone() { |
| 2815 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2832 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2816 !will_navigate_ && work_queue_.is_empty()) | 2833 !will_navigate_ && work_queue_.is_empty()) |
| 2817 delegate_->TestFinished(); | 2834 delegate_->TestFinished(); |
| 2818 layout_test_runtime_flags_.set_wait_until_done(false); | 2835 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2819 OnLayoutTestRuntimeFlagsChanged(); | 2836 OnLayoutTestRuntimeFlagsChanged(); |
| 2820 } | 2837 } |
| 2821 | 2838 |
| 2822 } // namespace test_runner | 2839 } // namespace test_runner |
| OLD | NEW |