| 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
|
| deleted file mode 100644
|
| index 0baac29cbfff2add256242e75faa3910b3fdffff..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/LayoutTests/bluetooth/writeValue.html
|
| +++ /dev/null
|
| @@ -1,130 +0,0 @@
|
| -<!DOCTYPE html>
|
| -<script src="../resources/testharness.js"></script>
|
| -<script src="../resources/testharnessreport.js"></script>
|
| -<script src="resources/bluetooth-helpers.js"></script>
|
| -<script>
|
| -'use strict';
|
| -
|
| -test(t => { assert_exists(window, 'testRunner'); t.done(); },
|
| - 'window.testRunner is required for the following tests.');
|
| -
|
| -promise_test(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService('generic_access'))
|
| - .then(service => service.getCharacteristic('gap.device_name'))
|
| - .then(characteristic => {
|
| - 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.');
|
| -
|
| -promise_test(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService('generic_access'))
|
| - .then(service => service.getCharacteristic('gap.device_name'))
|
| - .then(characteristic => {
|
| - 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.');
|
| -
|
| -promise_test(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService('generic_access'))
|
| - .then(service => service.getCharacteristic('gap.device_name'))
|
| - .then(characteristic => {
|
| - 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.');
|
| -
|
| -gatt_errors_tests.forEach(testSpec => {
|
| - promise_test(() => {
|
| - return setBluetoothFakeAdapter('FailingGATTOperationsAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: [errorUUID(0xA0)]}]}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService(errorUUID(0xA0)))
|
| - .then(service => service.getCharacteristic(testSpec.uuid))
|
| - .then(characteristic => {
|
| - return assert_promise_rejects_with_message(
|
| - characteristic.writeValue(new Uint8Array([1])),
|
| - testSpec.error,
|
| - 'Trying to write to a characteristic failed.');
|
| - });
|
| - }, testSpec.testName);
|
| -});
|
| -
|
| -promise_test(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService('generic_access'))
|
| - .then(service => service.getCharacteristic('gap.device_name'))
|
| - .then(characteristic => {
|
| - return assert_promise_rejects_with_message(
|
| - characteristic.writeValue(new Uint8Array(513 /* length */)),
|
| - new DOMException(
|
| - 'Value can\'t exceed 512 bytes.', 'InvalidModificationError'),
|
| - 'Value passed was too long.');
|
| - });
|
| -}, 'Trying to write more than 512 bytes should return an error.');
|
| -
|
| -promise_test(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .then(gattServer => gattServer.getPrimaryService('generic_access'))
|
| - .then(service => service.getCharacteristic('gap.device_name'))
|
| - .then(characteristic => Promise.all(
|
| - [characteristic.writeValue(new Uint8Array(1 /* length */)),
|
| - 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(() => {
|
| - return setBluetoothFakeAdapter('HeartRateAdapter')
|
| - .then(() => requestDeviceWithKeyDown({
|
| - filters: [{services: ['heart_rate']}],
|
| - optionalServices: ['generic_access']}))
|
| - .then(device => device.gatt.connect())
|
| - .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>
|
|
|