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

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

Issue 650613005: bluetooth: Initial WebBluetooth & WebBluetoothError. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Abandoned initial approach implementing BluetoothMock in Blink. Created 6 years, 2 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 | Annotate | Revision Log
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> 4 <script>
5
5 async_test(function(t) { 6 async_test(function(t) {
6 navigator.bluetooth.requestDevice() 7 navigator.bluetooth.requestDevice()
7 .then( 8 .then(
8 t.step_func(function() { assert_unreached( 9 t.step_func(function() { assert_unreached('Expected no default implementat ion.'); }),
9 'bluetooth.requestDevice() should not succeed until implemented.'); }), 10 t.step_func(function(e) {
10 t.step_func(function() { t.done() })); 11 assert_equals(e.name, 'NotSupportedError');
11 }, 'navigator.bluetooth.requestDevice not yet supported'); 12 t.done();
13 }));
14 }, 'NotSupportedError.');
15
16 async_test(function(t) {
17 internals.resetBluetoothMock(navigator);
18 internals.bluetoothRequestDeviceWillReject(navigator, 'NotFoundError');
19 navigator.bluetooth.requestDevice()
20 .then(
21 t.step_func(function() { assert_unreached('Mock was set to reject.'); }),
22 t.step_func(function(e) {
23 assert_equals(e.name, 'NotFoundError');
24 t.done();
25 }));
26 }, 'Reject with NotFoundError.');
27
28 async_test(function(t) {
29 internals.resetBluetoothMock(navigator);
30 internals.bluetoothRequestDeviceWillReject(navigator, 'SecurityError');
31 navigator.bluetooth.requestDevice()
32 .then(
33 t.step_func(function() { assert_unreached('Mock was set to reject.'); }),
34 t.step_func(function(e) {
35 assert_equals(e.name, 'SecurityError');
36 t.done();
37 }));
38 }, 'Reject with SecurityError.');
39
40 async_test(function(t) {
41 internals.resetBluetoothMock(navigator);
42 navigator.bluetooth.requestDevice()
43 .then(
44 t.step_func(function() { t.done() }),
45 t.step_func(function() { assert_unreached('Mock was set to resolve.'); })) ;
46 }, 'Mock will resolve.');
12 </script> 47 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/bluetooth/BluetoothDiscovery.h » ('j') | Source/modules/bluetooth/BluetoothDiscovery.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698