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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice.html

Issue 1415533006: bluetooth: Implement requestDevice by name or name prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-characteristic-properties
Patch Set: Merge with ToT and fix histograms conflict Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script> 3 <script src="../resources/testharness-helpers.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/bluetooth-helpers.js"></script> 5 <script src="resources/bluetooth-helpers.js"></script>
6 <script> 6 <script>
7 'use strict'; 7 'use strict';
8 8
9 test(function(t) { assert_true(window.testRunner instanceof Object); t.done(); } , 9 test(function(t) { assert_true(window.testRunner instanceof Object); t.done(); } ,
10 'window.testRunner is required for the following tests.'); 10 'window.testRunner is required for the following tests.');
11 11
12 promise_test(() => { 12 promise_test(() => {
13 testRunner.setBluetoothMockDataSet('EmptyAdapter');
14 return assert_promise_rejects(requestDeviceWithKeyDown(),
15 new TypeError());
16 }, 'Requires an argument.');
17
18 promise_test(() => {
19 testRunner.setBluetoothMockDataSet('EmptyAdapter');
20 return assert_promise_rejects(requestDeviceWithKeyDown({}),
21 new TypeError());
22 }, 'RequestDeviceOptions requires a |filters| member.');
23
24 promise_test(() => {
25 testRunner.setBluetoothMockDataSet('FailStartDiscoveryAdapter'); 13 testRunner.setBluetoothMockDataSet('FailStartDiscoveryAdapter');
26 testRunner.setBluetoothManualChooser(); 14 testRunner.setBluetoothManualChooser();
27 let requestDevicePromise = 15 let requestDevicePromise =
28 requestDeviceWithKeyDown({filters: [{services: ['generic_access']}]}); 16 requestDeviceWithKeyDown({filters: [{services: ['generic_access']}]});
29 return getBluetoothManualChooserEvents(3) 17 return getBluetoothManualChooserEvents(3)
30 .then(events => { 18 .then(events => {
31 assert_array_equals(events, 19 assert_array_equals(events,
32 ['chooser-opened(file:///)', 20 ['chooser-opened(file:///)',
33 'discovering', 21 'discovering',
34 'discovery-failed-to-start'], 22 'discovery-failed-to-start'],
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 assert_true(idsByName.has('Heart Rate Device')); 210 assert_true(idsByName.has('Heart Rate Device'));
223 assert_equals(events[2], 'discovery-idle'); 211 assert_equals(events[2], 'discovery-idle');
224 212
225 // Select it and let the test complete. 213 // Select it and let the test complete.
226 testRunner.sendBluetoothManualChooserEvent('selected', 214 testRunner.sendBluetoothManualChooserEvent('selected',
227 idsByName.get('Heart Rate Device' )); 215 idsByName.get('Heart Rate Device' ));
228 return requestDevicePromise; 216 return requestDevicePromise;
229 }).then(device => assert_equals(device.name, 'Heart Rate Device')); 217 }).then(device => assert_equals(device.name, 'Heart Rate Device'));
230 }, 'The chooser can restart the BT scan.'); 218 }, 'The chooser can restart the BT scan.');
231 </script> 219 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698