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

Unified 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: Add a forgotten semicolon. :-/ 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698