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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/connectGATT.html

Issue 1527853002: bluetooth: Add disconnect function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-device-identifier
Patch Set: Fix test that fails after upstream change. Created 4 years, 11 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-helpers.js"></script> 4 <script src="resources/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 7
8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, 8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
9 'window.testRunner is required for the following tests.'); 9 'window.testRunner is required for the following tests.');
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 }); 116 });
117 }, testSpec.testName); 117 }, testSpec.testName);
118 }); 118 });
119 119
120 promise_test(() => { 120 promise_test(() => {
121 testRunner.setBluetoothMockDataSet('HeartRateAdapter'); 121 testRunner.setBluetoothMockDataSet('HeartRateAdapter');
122 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) 122 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]})
123 .then(device => device.connectGATT()) 123 .then(device => device.connectGATT())
124 .then(gattServer => assert_true(gattServer.connected)); 124 .then(gattServer => assert_true(gattServer.connected));
125 }, 'Device will connect'); 125 }, 'Device will connect');
126
127 promise_test(() => {
128 testRunner.setBluetoothMockDataSet('');
129 testRunner.setBluetoothMockDataSet('HeartRateAdapter');
130 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]})
131 .then(device => {
132 return Promise.all([device.connectGATT(), device.connectGATT()])
133 }).then(gattServers => {
134 // connectGATT should return the same object if it was created earlier.
135 // TODO(ortuno): change to assert_equals.
136 assert_not_equals(gattServers[0], gattServers[1]);
137 });
138 });
126 </script> 139 </script>
OLDNEW
« no previous file with comments | « content/renderer/bluetooth/web_bluetooth_impl.cc ('k') | third_party/WebKit/LayoutTests/bluetooth/disconnect.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698