Index: components/test_runner/test_runner.cc |
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc |
index 7f73bbd922d25ac06b3fb3b4279334ce759ba320..0d1315789a530d5f3e18753177e223deedc47dd7 100644 |
--- a/components/test_runner/test_runner.cc |
+++ b/components/test_runner/test_runner.cc |
@@ -295,6 +295,10 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
void SetCustomTextOutput(std::string output); |
void SetViewSourceForFrame(const std::string& name, bool enabled); |
void SetBluetoothMockDataSet(const std::string& dataset_name); |
+ void SetBluetoothManualChooser(); |
+ std::vector<std::string> GetBluetoothManualChooserEvents(); |
+ void SendBluetoothManualChooserEvent(const std::string& event, |
+ const std::string& argument); |
void SetGeofencingMockProvider(bool service_available); |
void ClearGeofencingMockProvider(); |
void SetGeofencingMockPosition(double latitude, double longitude); |
@@ -566,8 +570,16 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
&TestRunnerBindings::SetCustomTextOutput) |
.SetMethod("setViewSourceForFrame", |
&TestRunnerBindings::SetViewSourceForFrame) |
+ // The 4 Bluetooth functions are specified at |
+ // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
.SetMethod("setBluetoothMockDataSet", |
&TestRunnerBindings::SetBluetoothMockDataSet) |
+ .SetMethod("setBluetoothManualChooser", |
+ &TestRunnerBindings::SetBluetoothManualChooser) |
+ .SetMethod("getBluetoothManualChooserEvents", |
+ &TestRunnerBindings::GetBluetoothManualChooserEvents) |
+ .SetMethod("sendBluetoothManualChooserEvent", |
+ &TestRunnerBindings::SendBluetoothManualChooserEvent) |
.SetMethod("forceNextWebGLContextCreationToFail", |
&TestRunnerBindings::ForceNextWebGLContextCreationToFail) |
.SetMethod("forceNextDrawingBufferCreationToFail", |
@@ -1333,6 +1345,24 @@ void TestRunnerBindings::SetBluetoothMockDataSet(const std::string& name) { |
runner_->SetBluetoothMockDataSet(name); |
} |
+void TestRunnerBindings::SetBluetoothManualChooser() { |
+ if (runner_) |
+ runner_->SetBluetoothManualChooser(); |
+} |
+ |
+std::vector<std::string> TestRunnerBindings::GetBluetoothManualChooserEvents() { |
+ if (runner_) |
+ return runner_->GetBluetoothManualChooserEvents(); |
+ return std::vector<std::string>(1, "No Test Runner"); |
+} |
+ |
+void TestRunnerBindings::SendBluetoothManualChooserEvent( |
+ const std::string& event, |
+ const std::string& argument) { |
+ if (runner_) |
+ runner_->SendBluetoothManualChooserEvent(event, argument); |
+} |
+ |
void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { |
if (runner_) |
runner_->SetPOSIXLocale(locale); |
@@ -2812,6 +2842,19 @@ void TestRunner::SetBluetoothMockDataSet(const std::string& name) { |
delegate_->SetBluetoothMockDataSet(name); |
} |
+void TestRunner::SetBluetoothManualChooser() { |
+ delegate_->SetBluetoothManualChooser(); |
+} |
+ |
+std::vector<std::string> TestRunner::GetBluetoothManualChooserEvents() { |
+ return delegate_->GetBluetoothManualChooserEvents(); |
+} |
+ |
+void TestRunner::SendBluetoothManualChooserEvent(const std::string& event, |
+ const std::string& argument) { |
+ delegate_->SendBluetoothManualChooserEvent(event, argument); |
+} |
+ |
void TestRunner::SetGeofencingMockProvider(bool service_available) { |
delegate_->SetGeofencingMockProvider(service_available); |
} |