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

Unified Diff: third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js

Issue 2859673003: bluetooth: Small web-bluetooth-test.js cleanup (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js
diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js b/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js
index eee28a3e18d1cc4748815f38276b702f755942a7..a178488da5b2ab64b37b3b3a6889e13fd992effa 100644
--- a/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js
+++ b/third_party/WebKit/LayoutTests/resources/bluetooth/web-bluetooth-test.js
@@ -27,10 +27,20 @@
// Set it to indicate whether the platform supports BLE. For example,
// Windows 7 is a platform that doesn't support Low Energy. On the other
// hand Windows 10 is a platform that does support LE, even if there is no
- // Bluetooth radio available.
- async setLESupported(available) {
- if (typeof available !== 'boolean') throw 'Type Not Supported';
- await (await this.getFakeBluetoothInterface_()).setLESupported(available);
+ // Bluetooth radio present.
+ async setLESupported(supported) {
+ // Call setBluetoothFakeAdapter() to clean up any fake adapters left over
+ // by legacy tests.
+ // Legacy tests that use setBluetoothFakeAdapter() sometimes fail to clean
+ // their fake adapter. This is not a problem for these tests because the
+ // next setBluetoothFakeAdapter() will clean it up anyway but it is a
+ // problem for the new tests that do not use setBluetoothFakeAdapter().
+ // TODO(crbug.com/569709): Remove once setBluetoothFakeAdapter is no
+ // longer used.
+ await setBluetoothFakeAdapter('');
+
+ if (typeof supported !== 'boolean') throw 'Type Not Supported';
+ await (await this.getFakeBluetoothInterface_()).setLESupported(supported);
}
async getFakeBluetoothInterface_() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698