Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/bluetooth/descriptor/writeValue/value-too-long.html |
| diff --git a/third_party/WebKit/LayoutTests/bluetooth/descriptor/writeValue/value-too-long.html b/third_party/WebKit/LayoutTests/bluetooth/descriptor/writeValue/value-too-long.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e04088c317b8bdee5c4ecffa96a5d981369665c9 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/bluetooth/descriptor/writeValue/value-too-long.html |
| @@ -0,0 +1,23 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script> |
| +<script> |
| +'use strict'; |
| +promise_test(() => { |
| + return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter') |
| + .then(() => requestDeviceWithKeyDown({ |
| + filters: [{services: ['health_thermometer']}]})) |
| + .then(device => device.gatt.connect()) |
| + .then(gattServer => gattServer.getPrimaryService('health_thermometer')) |
| + .then(service => service.getCharacteristic('measurement_interval')) |
| + .then(characteristic => characteristic.getDescriptor(user_description.name)) |
| + .then(descriptor => { |
| + return assert_promise_rejects_with_message( |
| + descriptor.writeValue(new Uint8Array(513 /* length */)), |
| + new DOMException( |
| + 'Value can\'t exceed 512 bytes.', 'InvalidModificationError'), |
| + 'Value passed was too long.'); |
| + }) |
| + }, 'A regular write request to a writable descriptor should succeed.'); |
|
ortuno
2017/01/28 00:22:51
nit: Fix description and formatting.
dougt
2017/01/31 00:31:25
Done.
|
| +</script> |