diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index 390878342dbc..2cb039959f3c 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -300,9 +300,8 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTCharacteristic { promise.resolve_native(promise_cx, &value); }, BluetoothResponse::WriteValue(result) => { - let value = ByteString::new(result); - *self.value.borrow_mut() = Some(value.clone()); - promise.resolve_native(promise_cx, &value); + *self.value.borrow_mut() = Some(ByteString::new(result)); + promise.resolve_native(promise_cx, &()); }, BluetoothResponse::EnableNotification(_result) => { promise.resolve_native(promise_cx, self); diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index ffe66c23becc..c5b67a44aec9 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -137,9 +137,8 @@ impl AsyncBluetoothListener for BluetoothRemoteGATTDescriptor { promise.resolve_native(promise_cx, &value); }, BluetoothResponse::WriteValue(result) => { - let value = ByteString::new(result); - *self.value.borrow_mut() = Some(value.clone()); - promise.resolve_native(promise_cx, &value); + *self.value.borrow_mut() = Some(ByteString::new(result)); + promise.resolve_native(promise_cx, &()); }, _ => promise.reject_error(promise_cx, Error::Type("Something went wrong...".to_owned())), } diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/characteristic/write-succeeds.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/characteristic/write-succeeds.html index f87d4c9d8ce6..4db85c7164f2 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/characteristic/write-succeeds.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/characteristic/write-succeeds.html @@ -13,6 +13,7 @@ .then(device => device.gatt.connect()) .then(gattServer => gattServer.getPrimaryService(generic_access.name)) .then(service => service.getCharacteristic(device_name.name)) - .then(characteristic => characteristic.writeValue(new Uint8Array(1))); + .then(characteristic => characteristic.writeValue(new Uint8Array(1))) + .then(result => assert_equals(result, undefined)); }, 'A regular write request to a writable characteristic should succeed.'); diff --git a/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/descriptor/write-succeeds.html b/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/descriptor/write-succeeds.html index 61afdd2a2dc8..bb72220fe04b 100644 --- a/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/descriptor/write-succeeds.html +++ b/tests/wpt/mozilla/tests/mozilla/bluetooth/writeValue/descriptor/write-succeeds.html @@ -14,6 +14,7 @@ .then(gattServer => gattServer.getPrimaryService(generic_access.name)) .then(service => service.getCharacteristic(device_name.name)) .then(characteristic => characteristic.getDescriptor(number_of_digitals.name)) - .then(descriptor => descriptor.writeValue(new Uint8Array(1))); + .then(descriptor => descriptor.writeValue(new Uint8Array(1))) + .then(result => assert_equals(result, undefined)); }, 'A regular write request to a writable descriptor should succeed.');