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

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

Issue 882223002: bluetooth: Add more attributes to WebBluetoothDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@gclient
Patch Set: addressed comment Created 5 years, 10 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 | « no previous file | Source/modules/bluetooth/BluetoothDevice.h » ('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/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 test(function() { 5 test(function() {
6 assert_throws(null, function() { new BluetoothDevice(); }, 6 assert_throws(null, function() { new BluetoothDevice(); },
7 'the constructor should not be callable with "new"'); 7 'the constructor should not be callable with "new"');
8 assert_throws(null, function() { BluetoothDevice(); }, 8 assert_throws(null, function() { BluetoothDevice(); },
9 'the constructor should not be callable'); 9 'the constructor should not be callable');
10 }, 'BluetoothDevice IDL test'); 10 }, 'BluetoothDevice IDL test');
11 11
12 test(function(t) { assert_exists(window, "testRunner"); t.done(); }, 12 test(function(t) { assert_exists(window, "testRunner"); t.done(); },
13 "window.testRunner is required for the following tests."); 13 "window.testRunner is required for the following tests.");
14 14
15 async_test(function(t) { 15 async_test(function(t) {
16 testRunner.setBluetoothMockDataSet('Single Empty Device'); 16 testRunner.setBluetoothMockDataSet('Single Empty Device');
17 navigator.bluetooth.requestDevice() 17 navigator.bluetooth.requestDevice()
18 .then( 18 .then(
19 t.step_func(function(device) { 19 t.step_func(function(device) {
20 assert_equals(device.constructor.name, "BluetoothDevice"); 20 assert_equals(device.constructor.name, "BluetoothDevice");
21 // Attempt (and fail) to clear all members, verifying they are readonly. 21
22 device.instanceId = "" 22 // Attempt (and fail) to overwrite all members, verifying they are reado nly.
23 assert_equals(device.instanceId, "Empty Mock deviceId"); 23 device.instanceID = "overwritten";
24
25 // FIXME: Remove "Empty Mock deviceId" after crrev.com/885723002 lands.
26 assert_true(device.instanceID === "Empty Mock deviceId" ||
27 device.instanceID === "Empty Mock Device instanceID");
28
24 t.done(); 29 t.done();
25 }), 30 }),
26 t.step_func(function() { assert_unreached('Mock was set to resolve.'); })) ; 31 t.step_func(function() { assert_unreached('Mock was set to resolve.'); })) ;
27 }, 'BluetoothDevice attributes.'); 32 }, 'BluetoothDevice attributes.');
28 </script> 33 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/bluetooth/BluetoothDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698