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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/server/connect/garbage-collection-ran-during-success.html

Issue 2874873003: bluetooth: Implement simulateGATTConnectionResponse() (Closed)
Patch Set: fix Created 3 years, 6 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/server/connect/garbage-collection-ran-during-success.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/server/connect/garbage-collection-ran-during-success.html b/third_party/WebKit/LayoutTests/bluetooth/server/connect/garbage-collection-ran-during-success.html
index 00b5c0a28f5659546fc03edb50ff32c94bff26cd..60156c1b9aca71ffcd04a78e1f97f29ddaf41dc5 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/server/connect/garbage-collection-ran-during-success.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/server/connect/garbage-collection-ran-during-success.html
@@ -2,16 +2,21 @@
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/bluetooth/bluetooth-helpers.js"></script>
+<script src="../../../resources/bluetooth/web-bluetooth-test.js"></script>
+<script src="../../../resources/mojo-helpers.js"></script>
<script>
'use strict';
promise_test(() => {
- return setBluetoothFakeAdapter('DisconnectingHealthThermometerAdapter')
- .then(() => requestDeviceWithKeyDown({
- filters: [{services: ['health_thermometer']}]}))
- .then(device => {
- device.gatt.connect();
+ return getDiscoveredHealthThermometerDevice()
+ .then(([device, fake_peripheral]) => {
+ return fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS})
+ .then(() => {
+ // Don't return the promise and let |device| go out of scope
+ // so that it gets garbage collected.
+ device.gatt.connect();
+ });
})
- .then(runGarbageCollection);
+ .then(runGarbageCollection)
}, 'Garbage Collection ran during a connect call that succeeds. ' +
'Should not crash.');
</script>

Powered by Google App Engine
This is Rietveld 408576698