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

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

Issue 1164393004: bluetooth: Layout tests for bluetooth error messages (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-read-value-impl
Patch Set: Fix error message test since message on browser side changed. Created 5 years, 6 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/readValue.html ('k') | no next file » | 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 src="bluetooth-helpers.js"></script> 4 <script src="bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 test(function(t) { assert_exists(window, "testRunner"); t.done(); }, 6 test(function(t) { assert_exists(window, "testRunner"); t.done(); },
7 "window.testRunner is required for the following tests."); 7 "window.testRunner is required for the following tests.");
8 8
9 sequential_promise_test(function() { 9 sequential_promise_test(function() {
10 testRunner.setBluetoothMockDataSet('EmptyAdapter'); 10 testRunner.setBluetoothMockDataSet('EmptyAdapter');
11 return navigator.bluetooth.requestDevice().then(function() { 11 return navigator.bluetooth.requestDevice().then(function() {
12 assert_unreached('Expected no devices but one was returned.'); 12 assert_unreached('Expected no devices but one was returned.');
13 }, function(e) { 13 }, function(e) {
14 assert_equals(e.name, 'NotFoundError'); 14 assert_equals(e.name, 'NotFoundError');
15 assert_equals(e.message, 'No Bluetooth devices in range.');
15 }); 16 });
16 }, 'Reject with NotFoundError.'); 17 }, 'Reject with NotFoundError.');
17 18
18 sequential_promise_test(function() { 19 sequential_promise_test(function() {
19 testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter'); 20 testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter');
20 return navigator.bluetooth.requestDevice().then(function(device) { 21 return navigator.bluetooth.requestDevice().then(function(device) {
21 assert_equals(device.constructor.name, "BluetoothDevice"); 22 assert_equals(device.constructor.name, "BluetoothDevice");
22 }); 23 });
23 }, 'Mock will resolve.'); 24 }, 'Mock will resolve.');
24 </script> 25 </script>
OLDNEW
« no previous file with comments | « LayoutTests/bluetooth/readValue.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698