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

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

Issue 1910933002: bluetooth: Separate requestDevice tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-gatt-connect
Patch Set: Merge Created 4 years, 7 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
Index: third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
diff --git a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
index 91377756e4ff035b1b35ebb1528b13536cef6b7e..462b5ba8fc43ed9207acd8d768fd2b1cd8f0901c 100644
--- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
+++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
@@ -305,23 +305,36 @@ class EventCatcher {
}
}
+function generateRequestDeviceArgsWithServices(services) {
+ services = (services === undefined) ? ['heart_rate'] : services;
Jeffrey Yasskin 2016/05/09 22:09:58 Make this an if statement: if (services === undef
ortuno 2016/05/11 19:29:39 Used default argument instead.
Jeffrey Yasskin 2016/05/11 20:27:17 Oh, cool. Yay for new Javascript features.
+ return [{
+ filters: [{ services: services}]
Jeffrey Yasskin 2016/05/09 22:09:58 Nit: Be symmetric with the spaces inside {}s: prob
ortuno 2016/05/11 19:29:39 Done.
+ }, {
+ filters: [{ services: services, name: 'Name'}]
+ }, {
+ filters: [{ services: services, namePrefix: 'Pre'}]
+ }, {
+ filters: [{ services: services, name: 'Name', namePrefix: 'Pre'}]
+ }, {
+ filters: [{ services: services}],
+ optionalServices: ['heart_rate']
+ }, {
+ filters: [{ services: services, name: 'Name'}],
+ optionalServices: ['heart_rate']
+ }, {
+ filters: [{ services: services, namePrefix: 'Pre'}],
+ optionalServices: ['heart_rate']
+ }, {
+ filters: [{ services: services, name: 'Name', namePrefix: 'Pre'}],
+ optionalServices: ['heart_rate']
+ }];
+}
+
// Bluetooth tests sometimes have left-over state that could leak into the
// next test. add_result_callback which is exposed by testharness.js allows us
-// to clean up this state after each test. In the future we will split tests
-// into separate files so that we don't have to add this callback ourselves.
-// TODO(ortuno): Split tests into separate files.
-// https://crbug.com/554240
+// to clean up this state after each test. Once the move to Mojo is complete
Jeffrey Yasskin 2016/05/09 22:09:58 If this is the last change to split up tests, remo
ortuno 2016/05/11 19:29:39 We can't get rid of the adapter one yet because ou
Jeffrey Yasskin 2016/05/11 20:27:17 SG
+// we will no longer need to clean up the state manually.
+// https://crbug.com/508771
add_result_callback(() => {
- // At the end of each test we clean up all the leftover data in the browser,
- // including revoking permissions. This happens before the test document is
- // detached. Once the document is detached any device that connected tries
- // to disconnect but by then the document no longer has permission to
- // interact with the device. So before we clean up the browser data
- // we change the visibility which results in all devices disconnecing.
- // TODO(ortuno): Remove setPageVisibility hack. In the future, the browser
- // will notify the renderer that the device disconnected so we won't need
- // this hack.
- // https://crbug.com/581855
- testRunner.setBluetoothManualChooser(false);
setBluetoothFakeAdapter('');
});

Powered by Google App Engine
This is Rietveld 408576698