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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/requestDevice/chooser/new-scan-services-discovered.html

Issue 2762023002: work in progress 2
Patch Set: Created 3 years, 9 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 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/testharnessreport.js"></script> 3 <script src="../../../resources/testharnessreport.js"></script>
4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> 4 <script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 promise_test(() => { 7 promise_test(() => {
8 testRunner.setBluetoothManualChooser(true); 8 testRunner.setBluetoothManualChooser(true);
9 9
10 let requestDevicePromise = 10 let requestDevicePromise =
11 setBluetoothFakeAdapter('DeviceEventAdapter') 11 setBluetoothFakeAdapter('DeviceEventAdapter')
12 .then(() => requestDeviceWithKeyDown({ 12 .then(() => requestDeviceWithKeyDown({
13 filters: [{services: ['generic_access']}]})); 13 filters: [{services: ['generic_access']}]}));
14 return getBluetoothManualChooserEvents(4).then(events => { 14 return getBluetoothManualChooserEvents(4).then(events => {
15 assert_equals(events[0], 'chooser-opened(file://)'); 15 assert_equals(events[0], 'chooser-opened(file://)');
16 assert_equals(events[1], 'discovering'); 16 assert_false(events[1], 'discovery-failed-to-start');
17 let idsByName = new AddDeviceEventSet(); 17 let idsByName = new AddDeviceEventSet();
18 idsByName.assert_add_device_event(events[2]); 18 idsByName.assert_add_device_event(events[2]);
19 assert_false(idsByName.has('test'));
19 assert_true(idsByName.has('Discovery Generic Access Device')); 20 assert_true(idsByName.has('Discovery Generic Access Device'));
20 assert_equals(events[3], 'discovery-idle'); 21 assert_equals(events[3], 'discovery-idle');
21 testRunner.sendBluetoothManualChooserEvent( 22 testRunner.sendBluetoothManualChooserEvent(
22 'selected', idsByName.get('Discovery Generic Access Device')); 23 'selected', idsByName.get('Discovery Generic Access Device'));
23 return requestDevicePromise; 24 return requestDevicePromise;
24 }); 25 });
25 }); 26 });
26 </script> 27 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698