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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/writeValue/write-fails.html

Issue 1844153002: bluetooth: Split writeValue tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-testrunner-mojo
Patch Set: Merge Created 4 years, 9 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/writeValue/write-fails.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-fails.html b/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-fails.html
new file mode 100644
index 0000000000000000000000000000000000000000..068cf034f38c128419e5d4f8adb9d3e428af33a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bluetooth/writeValue/write-fails.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/bluetooth-helpers.js"></script>
+<script>
+'use strict';
+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);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698