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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.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-succeeds.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-succeeds.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html
similarity index 65%
copy from third_party/WebKit/LayoutTests/bluetooth/writeValue/write-succeeds.html
copy to third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html
index 5b37b3c12eae7e19cfe3b3ef6e7678fd13f9d555..e10b3276ac2de5d1888913d191ccfb13530300f3 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-succeeds.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/read-succeeds.html
@@ -12,9 +12,11 @@ promise_test(() => {
.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.');
+ .then(characteristic => characteristic.readValue())
+ .then(value => {
+ let decoder = new TextDecoder('utf-8');
+ let value_str = decoder.decode(value);
+ assert_equals(value_str, 'Heart Rate Device');
+ });
+}, 'A read request succeeds and returns the charactersitic\'s value.');
Jeffrey Yasskin 2016/04/19 17:48:45 sp: charactersitic -> characteristic
ortuno 2016/04/19 20:04:29 Done.
</script>

Powered by Google App Engine
This is Rietveld 408576698