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

Side by Side Diff: LayoutTests/bluetooth/idl-BluetoothDevice.html

Issue 1216203003: Replace all sequential_promise_tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@update-testharnessjs
Patch Set: Created 5 years, 5 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
« no previous file with comments | « LayoutTests/bluetooth/getPrimaryService.html ('k') | LayoutTests/bluetooth/readValue.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
4 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
5 <script src="bluetooth-helpers.js"></script> 4 <script src="bluetooth-helpers.js"></script>
6 <script> 5 <script>
7 test(function() { 6 test(function() {
8 assert_throws(null, function() { new BluetoothDevice(); }, 7 assert_throws(null, function() { new BluetoothDevice(); },
9 'the constructor should not be callable with "new"'); 8 'the constructor should not be callable with "new"');
10 assert_throws(null, function() { BluetoothDevice(); }, 9 assert_throws(null, function() { BluetoothDevice(); },
11 'the constructor should not be callable'); 10 'the constructor should not be callable');
12 }, 'BluetoothDevice IDL test'); 11 }, 'BluetoothDevice IDL test');
13 12
14 test(function(t) { assert_true(window.testRunner instanceof Object); t.done(); } , 13 test(function(t) { assert_true(window.testRunner instanceof Object); t.done(); } ,
15 "window.testRunner is required for the following tests."); 14 "window.testRunner is required for the following tests.");
16 15
17 sequential_promise_test(function() { 16 promise_test(function() {
18 testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter'); 17 testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter');
19 return navigator.bluetooth.requestDevice({ 18 return navigator.bluetooth.requestDevice({
20 filters: [{services: [genericAccessServiceUuid]}] 19 filters: [{services: [genericAccessServiceUuid]}]
21 }).then(function(device) { 20 }).then(function(device) {
22 assert_equals(device.constructor.name, "BluetoothDevice"); 21 assert_equals(device.constructor.name, "BluetoothDevice");
23 22
24 // Attempt (and fail) to overwrite all members, verifying they are readonly. 23 // Attempt (and fail) to overwrite all members, verifying they are readonly.
25 device.instanceID = "overwritten"; 24 device.instanceID = "overwritten";
26 device.name = "overwritten"; 25 device.name = "overwritten";
27 device.deviceClass = "overwritten"; 26 device.deviceClass = "overwritten";
(...skipping 10 matching lines...) Expand all
38 assert_equals(device.vendorIDSource, "bluetooth"); 37 assert_equals(device.vendorIDSource, "bluetooth");
39 assert_equals(device.vendorID, 0xFFFF); 38 assert_equals(device.vendorID, 0xFFFF);
40 assert_equals(device.productID, 1); 39 assert_equals(device.productID, 1);
41 assert_equals(device.productVersion, 2); 40 assert_equals(device.productVersion, 2);
42 assert_equals(device.paired, true); 41 assert_equals(device.paired, true);
43 assert_equals(device.uuids[0], genericAccessServiceUuid); 42 assert_equals(device.uuids[0], genericAccessServiceUuid);
44 assert_equals(device.uuids[1], genericAttributeServiceUuid); 43 assert_equals(device.uuids[1], genericAttributeServiceUuid);
45 }); 44 });
46 }, 'BluetoothDevice attributes.'); 45 }, 'BluetoothDevice attributes.');
47 </script> 46 </script>
OLDNEW
« no previous file with comments | « LayoutTests/bluetooth/getPrimaryService.html ('k') | LayoutTests/bluetooth/readValue.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698