From dd733f6994e27a91e46fb8f9feb9a7e7179cfcda Mon Sep 17 00:00:00 2001 From: zakorgyula Date: Fri, 7 Oct 2016 14:17:51 +0200 Subject: [PATCH] Update the value of the Characteristic/Descriptor when calling writeValue. --- components/script/dom/bluetoothremotegattcharacteristic.rs | 4 ++-- components/script/dom/bluetoothremotegattdescriptor.rs | 4 ++-- .../writeValue/characteristic/write-updates-value.html.ini | 4 ---- .../writeValue/descriptor/write-updates-value.html.ini | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/characteristic/write-updates-value.html.ini delete mode 100644 tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/descriptor/write-updates-value.html.ini diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index 16a2bde68f5..49207d09fbd 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -188,10 +188,10 @@ impl BluetoothRemoteGATTCharacteristic { } let (sender, receiver) = ipc::channel().unwrap(); self.get_bluetooth_thread().send( - BluetoothMethodMsg::WriteValue(self.get_instance_id(), value, sender)).unwrap(); + BluetoothMethodMsg::WriteValue(self.get_instance_id(), value.clone(), sender)).unwrap(); let result = receiver.recv().unwrap(); match result { - Ok(_) => Ok(()), + Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))), Err(error) => { Err(Error::from(error)) }, diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index 5ca51f45439..c7e64b7305c 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -105,10 +105,10 @@ impl BluetoothRemoteGATTDescriptor { } let (sender, receiver) = ipc::channel().unwrap(); self.get_bluetooth_thread().send( - BluetoothMethodMsg::WriteValue(self.get_instance_id(), value, sender)).unwrap(); + BluetoothMethodMsg::WriteValue(self.get_instance_id(), value.clone(), sender)).unwrap(); let result = receiver.recv().unwrap(); match result { - Ok(_) => Ok(()), + Ok(_) => Ok(*self.value.borrow_mut() = Some(ByteString::new(value))), Err(error) => { Err(Error::from(error)) }, diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/characteristic/write-updates-value.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/characteristic/write-updates-value.html.ini deleted file mode 100644 index a61aadb0883..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/characteristic/write-updates-value.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[write-updates-value.html] - type: testharness - [A regular write request to a writable characteristic should update value.] - expected: FAIL diff --git a/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/descriptor/write-updates-value.html.ini b/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/descriptor/write-updates-value.html.ini deleted file mode 100644 index f96edea6781..00000000000 --- a/tests/wpt/mozilla/meta/mozilla/bluetooth/writeValue/descriptor/write-updates-value.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[write-updates-value.html] - type: testharness - [A regular write request to a writable descriptor should update value.] - expected: FAIL