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

Unified Diff: LayoutTests/http/tests/geofencing/resources/worker.js

Issue 543203003: Fix the geofencing test to not break if the promises resolve asynchronously. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 6 years, 3 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: LayoutTests/http/tests/geofencing/resources/worker.js
diff --git a/LayoutTests/http/tests/geofencing/resources/worker.js b/LayoutTests/http/tests/geofencing/resources/worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..d48c15f428207d16228b803c78bf8469656a0277
--- /dev/null
+++ b/LayoutTests/http/tests/geofencing/resources/worker.js
@@ -0,0 +1,21 @@
+importScripts('../../serviceworker/resources/worker-test-harness.js');
+
+promise_test(function(test) {
+ return navigator.geofencing.registerRegion(
+ new CircularGeofencingRegion({latitude: 37.421999,
+ longitude: -122.084015}))
+ .then(test.unreached_func('Promise should not have resolved'))
+ .catch(function() { });
+ }, 'registerRegion should fail');
+
+promise_test(function(test) {
+ return navigator.geofencing.unregisterRegion("")
+ .then(test.unreached_func('Promise should not have resolved'))
+ .catch(function() { });
+ }, 'unregisterRegion should fail');
+
+promise_test(function(test) {
+ return navigator.geofencing.getRegisteredRegions()
+ .then(test.unreached_func('Promise should not have resolved'))
+ .catch(function() { });
+ }, 'getRegisteredRegions should fail');
« no previous file with comments | « LayoutTests/geofencing/geofencing-not-implemented-expected.txt ('k') | LayoutTests/http/tests/geofencing/service-worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698