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

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: Replace uses of assert_promise_rejects because it was removed. 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
« no previous file with comments | « third_party/WebKit/LayoutTests/bluetooth/requestDevice/two-filters.html ('k') | 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/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..6735a3b04e706217177533717911ac0baa13a87d 100644
--- a/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
+++ b/third_party/WebKit/LayoutTests/resources/bluetooth/bluetooth-helpers.js
@@ -305,23 +305,35 @@ class EventCatcher {
}
}
+function generateRequestDeviceArgsWithServices(services = ['heart_rate']) {
+ return [{
+ filters: [{ services: services }]
+ }, {
+ 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
+// 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('');
});
« no previous file with comments | « third_party/WebKit/LayoutTests/bluetooth/requestDevice/two-filters.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698