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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html

Issue 1884133005: bluetooth: Separate readValue tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-mojo-read-value
Patch Set: Merge Created 4 years, 8 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/readValue/read-updates-value.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-updates-value.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html
similarity index 69%
copy from third_party/WebKit/LayoutTests/bluetooth/writeValue/write-updates-value.html
copy to third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html
index 8746df7e2425bcd35a80bbcacf1964db9e99cc81..ee7d212a39d270dd2a762291f0c456aabfcc5cec 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-updates-value.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-updates-value.html
@@ -14,11 +14,11 @@ promise_test(() => {
.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);
- });
+ return characteristic.readValue().then(() => {
+ let decoder = new TextDecoder('utf-8');
+ let value_str = decoder.decode(characteristic.value);
+ assert_equals(value_str, 'Heart Rate Device');
+ })
});
-}, 'A regular write request to a writable characteristic should update value.');
+}, 'Succesful read should update characteristic.value');
</script>

Powered by Google App Engine
This is Rietveld 408576698