Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: components/test_runner/test_runner.cc

Issue 1325953002: Add functions to let tests read and control the Bluetooth chooser state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "components/test_runner/mock_credential_manager_client.h" 10 #include "components/test_runner/mock_credential_manager_client.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 void LayoutAndPaintAsync(); 288 void LayoutAndPaintAsync();
289 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback); 289 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback);
290 void GetManifestThen(v8::Local<v8::Function> callback); 290 void GetManifestThen(v8::Local<v8::Function> callback);
291 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); 291 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback);
292 void CopyImageAtAndCapturePixelsAsyncThen(int x, 292 void CopyImageAtAndCapturePixelsAsyncThen(int x,
293 int y, 293 int y,
294 v8::Local<v8::Function> callback); 294 v8::Local<v8::Function> callback);
295 void SetCustomTextOutput(std::string output); 295 void SetCustomTextOutput(std::string output);
296 void SetViewSourceForFrame(const std::string& name, bool enabled); 296 void SetViewSourceForFrame(const std::string& name, bool enabled);
297 void SetBluetoothMockDataSet(const std::string& dataset_name); 297 void SetBluetoothMockDataSet(const std::string& dataset_name);
298 void SetBluetoothManualChooser();
299 std::vector<std::string> GetBluetoothManualChooserEvents();
300 void SendBluetoothManualChooserEvent(const std::string& event,
301 const std::string& argument);
298 void SetGeofencingMockProvider(bool service_available); 302 void SetGeofencingMockProvider(bool service_available);
299 void ClearGeofencingMockProvider(); 303 void ClearGeofencingMockProvider();
300 void SetGeofencingMockPosition(double latitude, double longitude); 304 void SetGeofencingMockPosition(double latitude, double longitude);
301 void SetPermission(const std::string& name, 305 void SetPermission(const std::string& name,
302 const std::string& value, 306 const std::string& value,
303 const std::string& origin, 307 const std::string& origin,
304 const std::string& embedding_origin); 308 const std::string& embedding_origin);
305 void DispatchBeforeInstallPromptEvent( 309 void DispatchBeforeInstallPromptEvent(
306 int request_id, 310 int request_id,
307 const std::vector<std::string>& event_platforms, 311 const std::vector<std::string>& event_platforms,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 .SetMethod("capturePixelsAsyncThen", 565 .SetMethod("capturePixelsAsyncThen",
562 &TestRunnerBindings::CapturePixelsAsyncThen) 566 &TestRunnerBindings::CapturePixelsAsyncThen)
563 .SetMethod("copyImageAtAndCapturePixelsAsyncThen", 567 .SetMethod("copyImageAtAndCapturePixelsAsyncThen",
564 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen) 568 &TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen)
565 .SetMethod("setCustomTextOutput", 569 .SetMethod("setCustomTextOutput",
566 &TestRunnerBindings::SetCustomTextOutput) 570 &TestRunnerBindings::SetCustomTextOutput)
567 .SetMethod("setViewSourceForFrame", 571 .SetMethod("setViewSourceForFrame",
568 &TestRunnerBindings::SetViewSourceForFrame) 572 &TestRunnerBindings::SetViewSourceForFrame)
569 .SetMethod("setBluetoothMockDataSet", 573 .SetMethod("setBluetoothMockDataSet",
570 &TestRunnerBindings::SetBluetoothMockDataSet) 574 &TestRunnerBindings::SetBluetoothMockDataSet)
575 .SetMethod("setBluetoothManualChooser",
576 &TestRunnerBindings::SetBluetoothManualChooser)
577 .SetMethod("getBluetoothManualChooserEvents",
578 &TestRunnerBindings::GetBluetoothManualChooserEvents)
579 .SetMethod("sendBluetoothManualChooserEvent",
580 &TestRunnerBindings::SendBluetoothManualChooserEvent)
571 .SetMethod("forceNextWebGLContextCreationToFail", 581 .SetMethod("forceNextWebGLContextCreationToFail",
572 &TestRunnerBindings::ForceNextWebGLContextCreationToFail) 582 &TestRunnerBindings::ForceNextWebGLContextCreationToFail)
573 .SetMethod("forceNextDrawingBufferCreationToFail", 583 .SetMethod("forceNextDrawingBufferCreationToFail",
574 &TestRunnerBindings::ForceNextDrawingBufferCreationToFail) 584 &TestRunnerBindings::ForceNextDrawingBufferCreationToFail)
575 .SetMethod("setGeofencingMockProvider", 585 .SetMethod("setGeofencingMockProvider",
576 &TestRunnerBindings::SetGeofencingMockProvider) 586 &TestRunnerBindings::SetGeofencingMockProvider)
577 .SetMethod("clearGeofencingMockProvider", 587 .SetMethod("clearGeofencingMockProvider",
578 &TestRunnerBindings::ClearGeofencingMockProvider) 588 &TestRunnerBindings::ClearGeofencingMockProvider)
579 .SetMethod("setGeofencingMockPosition", 589 .SetMethod("setGeofencingMockPosition",
580 &TestRunnerBindings::SetGeofencingMockPosition) 590 &TestRunnerBindings::SetGeofencingMockPosition)
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 const std::string& name, v8::Local<v8::Function> callback) { 1336 const std::string& name, v8::Local<v8::Function> callback) {
1327 if (runner_) 1337 if (runner_)
1328 runner_->SetColorProfile(name, callback); 1338 runner_->SetColorProfile(name, callback);
1329 } 1339 }
1330 1340
1331 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { 1341 void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) {
1332 if (runner_) 1342 if (runner_)
1333 runner_->SetBluetoothMockDataSet(name); 1343 runner_->SetBluetoothMockDataSet(name);
1334 } 1344 }
1335 1345
1346 void TestRunnerBindings::SetBluetoothManualChooser() {
1347 if (runner_)
1348 runner_->SetBluetoothManualChooser();
1349 }
1350
1351 std::vector<std::string> TestRunnerBindings::GetBluetoothManualChooserEvents() {
1352 if (runner_)
1353 return runner_->GetBluetoothManualChooserEvents();
1354 return std::vector<std::string>(1, "No Test Runner");
1355 }
1356
1357 void TestRunnerBindings::SendBluetoothManualChooserEvent(
1358 const std::string& event,
1359 const std::string& argument) {
1360 if (runner_)
1361 runner_->SendBluetoothManualChooserEvent(event, argument);
1362 }
1363
1336 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { 1364 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) {
1337 if (runner_) 1365 if (runner_)
1338 runner_->SetPOSIXLocale(locale); 1366 runner_->SetPOSIXLocale(locale);
1339 } 1367 }
1340 1368
1341 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { 1369 void TestRunnerBindings::SetMIDIAccessorResult(bool result) {
1342 if (runner_) 1370 if (runner_)
1343 runner_->SetMIDIAccessorResult(result); 1371 runner_->SetMIDIAccessorResult(result);
1344 } 1372 }
1345 1373
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 void TestRunner::SetColorProfile(const std::string& name, 2833 void TestRunner::SetColorProfile(const std::string& name,
2806 v8::Local<v8::Function> callback) { 2834 v8::Local<v8::Function> callback) {
2807 delegate_->SetDeviceColorProfile(name); 2835 delegate_->SetDeviceColorProfile(name);
2808 delegate_->PostTask(new InvokeCallbackTask(this, callback)); 2836 delegate_->PostTask(new InvokeCallbackTask(this, callback));
2809 } 2837 }
2810 2838
2811 void TestRunner::SetBluetoothMockDataSet(const std::string& name) { 2839 void TestRunner::SetBluetoothMockDataSet(const std::string& name) {
2812 delegate_->SetBluetoothMockDataSet(name); 2840 delegate_->SetBluetoothMockDataSet(name);
2813 } 2841 }
2814 2842
2843 void TestRunner::SetBluetoothManualChooser() {
2844 delegate_->SetBluetoothManualChooser();
2845 }
2846
2847 std::vector<std::string> TestRunner::GetBluetoothManualChooserEvents() {
2848 return delegate_->GetBluetoothManualChooserEvents();
2849 }
2850
2851 void TestRunner::SendBluetoothManualChooserEvent(const std::string& event,
2852 const std::string& argument) {
2853 delegate_->SendBluetoothManualChooserEvent(event, argument);
2854 }
2855
2815 void TestRunner::SetGeofencingMockProvider(bool service_available) { 2856 void TestRunner::SetGeofencingMockProvider(bool service_available) {
2816 delegate_->SetGeofencingMockProvider(service_available); 2857 delegate_->SetGeofencingMockProvider(service_available);
2817 } 2858 }
2818 2859
2819 void TestRunner::ClearGeofencingMockProvider() { 2860 void TestRunner::ClearGeofencingMockProvider() {
2820 delegate_->ClearGeofencingMockProvider(); 2861 delegate_->ClearGeofencingMockProvider();
2821 } 2862 }
2822 2863
2823 void TestRunner::SetGeofencingMockPosition(double latitude, double longitude) { 2864 void TestRunner::SetGeofencingMockPosition(double latitude, double longitude) {
2824 delegate_->SetGeofencingMockPosition(latitude, longitude); 2865 delegate_->SetGeofencingMockPosition(latitude, longitude);
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
3066 } 3107 }
3067 3108
3068 void TestRunner::DidLosePointerLockInternal() { 3109 void TestRunner::DidLosePointerLockInternal() {
3069 bool was_locked = pointer_locked_; 3110 bool was_locked = pointer_locked_;
3070 pointer_locked_ = false; 3111 pointer_locked_ = false;
3071 if (was_locked) 3112 if (was_locked)
3072 web_view_->didLosePointerLock(); 3113 web_view_->didLosePointerLock();
3073 } 3114 }
3074 3115
3075 } // namespace test_runner 3116 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698