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

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

Issue 1611443002: bluetooth: Update BluetoothGATTCharacteristic.value on writeValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@useDataview
Patch Set: 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 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 881cf22d62f2c39f9ec63fc17988ae0183d6bd49..992784d78dffb8186895d01fa205dad04982bde6 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
@@ -98,4 +98,20 @@ promise_test(() => {
characteristic.writeValue(new ArrayBuffer(1 /* length */)),
characteristic.writeValue(new DataView(new ArrayBuffer(1 /* length */)))]));
}, 'A regular write request to a writable characteristic should succeed.');
+
+promise_test(() => {
+ testRunner.setBluetoothMockDataSet('HeartRateAdapter');
+ return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]})
+ .then(device => device.connectGATT())
+ .then(gattServer => gattServer.getPrimaryService('generic_access'))
+ .then(service => service.getCharacteristic('gap.device_name'))
+ .then(characteristic => {
+ assert_equals(characteristic.value, null);
+ let textEncoder = new TextEncoder();
+ let newValue = textEncoder.encode('foo');
+ return characteristic.writeValue(newValue).then(() => {
+ assert_array_equals(characteristic.value.buffer, newValue.buffer);
+ });
+ });
+}, 'A regular write request to a writable characteristic should update value.');
</script>

Powered by Google App Engine
This is Rietveld 408576698