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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/writeValue.html

Issue 1815483003: bluetooth: Create Mojo equivalent of SetBluetoothMockDataSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo
Patch Set: Add gyp Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/bluetooth/writeValue.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/writeValue.html b/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
index eb0bdf88293075e22886aa55e3459bb71f5b872e..3e4744fe3d3b7db64be886d30af2a5a3e71ab1ea 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
@@ -16,12 +16,12 @@ promise_test(() => {
.then(gattServer => gattServer.getPrimaryService('generic_access'))
.then(service => service.getCharacteristic('gap.device_name'))
.then(characteristic => {
- testRunner.setBluetoothMockDataSet('EmptyAdapter');
- return assert_promise_rejects_with_message(
- characteristic.writeValue(new ArrayBuffer(1 /* length */)),
- new DOMException(
- 'Bluetooth Device is no longer in range.', 'NetworkError'),
- 'Device went out of range.');
+ return setBluetoothFakeAdapter('EmptyAdapter')
+ .then(() => assert_promise_rejects_with_message(
+ characteristic.writeValue(new ArrayBuffer(1 /* length */)),
+ new DOMException(
+ 'Bluetooth Device is no longer in range.', 'NetworkError'),
+ 'Device went out of range.'));
});
}, 'Device goes out of range. Reject with NetworkError.');
@@ -33,12 +33,12 @@ promise_test(() => {
.then(gattServer => gattServer.getPrimaryService('generic_access'))
.then(service => service.getCharacteristic('gap.device_name'))
.then(characteristic => {
- testRunner.setBluetoothMockDataSet('MissingServiceHeartRateAdapter');
- return assert_promise_rejects_with_message(
- characteristic.writeValue(new ArrayBuffer(1 /* length */)),
- new DOMException('GATT Service no longer exists.',
- 'InvalidStateError'),
- 'Service got removed.');
+ return setBluetoothFakeAdapter('MissingServiceHeartRateAdapter')
+ .then(() => assert_promise_rejects_with_message(
+ characteristic.writeValue(new ArrayBuffer(1 /* length */)),
+ new DOMException('GATT Service no longer exists.',
+ 'InvalidStateError'),
+ 'Service got removed.'));
});
}, 'Service gets removed. Reject with InvalidStateError.');
@@ -50,12 +50,12 @@ promise_test(() => {
.then(gattServer => gattServer.getPrimaryService('generic_access'))
.then(service => service.getCharacteristic('gap.device_name'))
.then(characteristic => {
- testRunner.setBluetoothMockDataSet('MissingCharacteristicHeartRateAdapter');
- return assert_promise_rejects_with_message(
- characteristic.writeValue(new ArrayBuffer(1 /* length */)),
- new DOMException(
- 'GATT Characteristic no longer exists.', 'InvalidStateError'),
- 'Characteristic got removed.');
+ return setBluetoothFakeAdapter('MissingCharacteristicHeartRateAdapter')
+ .then(() => assert_promise_rejects_with_message(
+ characteristic.writeValue(new ArrayBuffer(1 /* length */)),
+ new DOMException(
+ 'GATT Characteristic no longer exists.', 'InvalidStateError'),
+ 'Characteristic got removed.'));
});
}, 'Characteristic gets removed. Reject with InvalidStateError.');

Powered by Google App Engine
This is Rietveld 408576698