| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 void LayoutAndPaintAsync(); | 308 void LayoutAndPaintAsync(); |
| 309 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback); | 309 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback); |
| 310 void GetManifestThen(v8::Local<v8::Function> callback); | 310 void GetManifestThen(v8::Local<v8::Function> callback); |
| 311 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); | 311 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); |
| 312 void CopyImageAtAndCapturePixelsAsyncThen(int x, | 312 void CopyImageAtAndCapturePixelsAsyncThen(int x, |
| 313 int y, | 313 int y, |
| 314 v8::Local<v8::Function> callback); | 314 v8::Local<v8::Function> callback); |
| 315 void SetCustomTextOutput(const std::string& output); | 315 void SetCustomTextOutput(const std::string& output); |
| 316 void SetViewSourceForFrame(const std::string& name, bool enabled); | 316 void SetViewSourceForFrame(const std::string& name, bool enabled); |
| 317 void SetBluetoothMockDataSet(const std::string& dataset_name); | 317 void SetBluetoothMockDataSet(const std::string& dataset_name); |
| 318 void SetBluetoothFakeAdapter(const std::string& adapter_name, |
| 319 v8::Local<v8::Function> callback); |
| 318 void SetBluetoothManualChooser(); | 320 void SetBluetoothManualChooser(); |
| 319 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); | 321 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); |
| 320 void SendBluetoothManualChooserEvent(const std::string& event, | 322 void SendBluetoothManualChooserEvent(const std::string& event, |
| 321 const std::string& argument); | 323 const std::string& argument); |
| 322 void SetGeofencingMockProvider(bool service_available); | 324 void SetGeofencingMockProvider(bool service_available); |
| 323 void ClearGeofencingMockProvider(); | 325 void ClearGeofencingMockProvider(); |
| 324 void SetGeofencingMockPosition(double latitude, double longitude); | 326 void SetGeofencingMockPosition(double latitude, double longitude); |
| 325 void SetPermission(const std::string& name, | 327 void SetPermission(const std::string& name, |
| 326 const std::string& value, | 328 const std::string& value, |
| 327 const std::string& origin, | 329 const std::string& origin, |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", | 596 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", |
| 595 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) | 597 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) |
| 596 .SetMethod("setCustomTextOutput", | 598 .SetMethod("setCustomTextOutput", |
| 597 &TestRunnerBindings::SetCustomTextOutput) | 599 &TestRunnerBindings::SetCustomTextOutput) |
| 598 .SetMethod("setViewSourceForFrame", | 600 .SetMethod("setViewSourceForFrame", |
| 599 &TestRunnerBindings::SetViewSourceForFrame) | 601 &TestRunnerBindings::SetViewSourceForFrame) |
| 600 // The 4 Bluetooth functions are specified at | 602 // The 4 Bluetooth functions are specified at |
| 601 // https://webbluetoothcg.github.io/web-bluetooth/tests/. | 603 // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
| 602 .SetMethod("setBluetoothMockDataSet", | 604 .SetMethod("setBluetoothMockDataSet", |
| 603 &TestRunnerBindings::SetBluetoothMockDataSet) | 605 &TestRunnerBindings::SetBluetoothMockDataSet) |
| 606 .SetMethod("setBluetoothFakeAdapter", |
| 607 &TestRunnerBindings::SetBluetoothFakeAdapter) |
| 604 .SetMethod("setBluetoothManualChooser", | 608 .SetMethod("setBluetoothManualChooser", |
| 605 &TestRunnerBindings::SetBluetoothManualChooser) | 609 &TestRunnerBindings::SetBluetoothManualChooser) |
| 606 .SetMethod("getBluetoothManualChooserEvents", | 610 .SetMethod("getBluetoothManualChooserEvents", |
| 607 &TestRunnerBindings::GetBluetoothManualChooserEvents) | 611 &TestRunnerBindings::GetBluetoothManualChooserEvents) |
| 608 .SetMethod("sendBluetoothManualChooserEvent", | 612 .SetMethod("sendBluetoothManualChooserEvent", |
| 609 &TestRunnerBindings::SendBluetoothManualChooserEvent) | 613 &TestRunnerBindings::SendBluetoothManualChooserEvent) |
| 610 .SetMethod("forceNextWebGLContextCreationToFail", | 614 .SetMethod("forceNextWebGLContextCreationToFail", |
| 611 &TestRunnerBindings::ForceNextWebGLContextCreationToFail) | 615 &TestRunnerBindings::ForceNextWebGLContextCreationToFail) |
| 612 .SetMethod("forceNextDrawingBufferCreationToFail", | 616 .SetMethod("forceNextDrawingBufferCreationToFail", |
| 613 &TestRunnerBindings::ForceNextDrawingBufferCreationToFail) | 617 &TestRunnerBindings::ForceNextDrawingBufferCreationToFail) |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 const std::string& name, v8::Local<v8::Function> callback) { | 1377 const std::string& name, v8::Local<v8::Function> callback) { |
| 1374 if (runner_) | 1378 if (runner_) |
| 1375 runner_->SetColorProfile(name, callback); | 1379 runner_->SetColorProfile(name, callback); |
| 1376 } | 1380 } |
| 1377 | 1381 |
| 1378 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { | 1382 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { |
| 1379 if (runner_) | 1383 if (runner_) |
| 1380 runner_->SetBluetoothMockDataSet(name); | 1384 runner_->SetBluetoothMockDataSet(name); |
| 1381 } | 1385 } |
| 1382 | 1386 |
| 1387 void TestRunnerBindings::SetBluetoothFakeAdapter( |
| 1388 const std::string& adapter_name, |
| 1389 v8::Local<v8::Function> callback) { |
| 1390 if (runner_) |
| 1391 runner_->SetBluetoothFakeAdapter(adapter_name, callback); |
| 1392 } |
| 1393 |
| 1383 void TestRunnerBindings::SetBluetoothManualChooser() { | 1394 void TestRunnerBindings::SetBluetoothManualChooser() { |
| 1384 if (runner_) | 1395 if (runner_) |
| 1385 runner_->SetBluetoothManualChooser(); | 1396 runner_->SetBluetoothManualChooser(); |
| 1386 } | 1397 } |
| 1387 | 1398 |
| 1388 void TestRunnerBindings::GetBluetoothManualChooserEvents( | 1399 void TestRunnerBindings::GetBluetoothManualChooserEvents( |
| 1389 v8::Local<v8::Function> callback) { | 1400 v8::Local<v8::Function> callback) { |
| 1390 if (runner_) | 1401 if (runner_) |
| 1391 return runner_->GetBluetoothManualChooserEvents(callback); | 1402 return runner_->GetBluetoothManualChooserEvents(callback); |
| 1392 } | 1403 } |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2875 void TestRunner::SetColorProfile(const std::string& name, | 2886 void TestRunner::SetColorProfile(const std::string& name, |
| 2876 v8::Local<v8::Function> callback) { | 2887 v8::Local<v8::Function> callback) { |
| 2877 delegate_->SetDeviceColorProfile(name); | 2888 delegate_->SetDeviceColorProfile(name); |
| 2878 delegate_->PostTask(new InvokeCallbackTask(this, callback)); | 2889 delegate_->PostTask(new InvokeCallbackTask(this, callback)); |
| 2879 } | 2890 } |
| 2880 | 2891 |
| 2881 void TestRunner::SetBluetoothMockDataSet(const std::string& name) { | 2892 void TestRunner::SetBluetoothMockDataSet(const std::string& name) { |
| 2882 delegate_->SetBluetoothMockDataSet(name); | 2893 delegate_->SetBluetoothMockDataSet(name); |
| 2883 } | 2894 } |
| 2884 | 2895 |
| 2896 void TestRunner::SetBluetoothFakeAdapter(const std::string& adapter_name, |
| 2897 v8::Local<v8::Function> callback) { |
| 2898 scoped_ptr<InvokeCallbackTask> task(new InvokeCallbackTask(this, callback)); |
| 2899 delegate_->SetBluetoothFakeAdapter( |
| 2900 adapter_name, |
| 2901 base::Bind(&TestRunner::InvokeCallback, |
| 2902 weak_factory_.GetWeakPtr(), base::Passed(&task))); |
| 2903 } |
| 2904 |
| 2885 void TestRunner::SetBluetoothManualChooser() { | 2905 void TestRunner::SetBluetoothManualChooser() { |
| 2886 delegate_->SetBluetoothManualChooser(); | 2906 delegate_->SetBluetoothManualChooser(); |
| 2887 } | 2907 } |
| 2888 | 2908 |
| 2889 void TestRunner::GetBluetoothManualChooserEvents( | 2909 void TestRunner::GetBluetoothManualChooserEvents( |
| 2890 v8::Local<v8::Function> callback) { | 2910 v8::Local<v8::Function> callback) { |
| 2891 scoped_ptr<InvokeCallbackTask> task(new InvokeCallbackTask(this, callback)); | 2911 scoped_ptr<InvokeCallbackTask> task(new InvokeCallbackTask(this, callback)); |
| 2892 return delegate_->GetBluetoothManualChooserEvents( | 2912 return delegate_->GetBluetoothManualChooserEvents( |
| 2893 base::Bind(&TestRunner::GetBluetoothManualChooserEventsCallback, | 2913 base::Bind(&TestRunner::GetBluetoothManualChooserEventsCallback, |
| 2894 weak_factory_.GetWeakPtr(), base::Passed(&task))); | 2914 weak_factory_.GetWeakPtr(), base::Passed(&task))); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 } | 3222 } |
| 3203 | 3223 |
| 3204 void TestRunner::DidLosePointerLockInternal() { | 3224 void TestRunner::DidLosePointerLockInternal() { |
| 3205 bool was_locked = pointer_locked_; | 3225 bool was_locked = pointer_locked_; |
| 3206 pointer_locked_ = false; | 3226 pointer_locked_ = false; |
| 3207 if (was_locked) | 3227 if (was_locked) |
| 3208 web_view_->didLosePointerLock(); | 3228 web_view_->didLosePointerLock(); |
| 3209 } | 3229 } |
| 3210 | 3230 |
| 3211 } // namespace test_runner | 3231 } // namespace test_runner |
| OLD | NEW |