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: LayoutTests/http/tests/geofencing/apis_not_implemented.html

Issue 647493002: Move promise_test and assert_promise_rejects out of worker-test-harness. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@geofencing_serviceworker
Patch Set: fix typo Created 6 years, 2 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/apis_not_implemented.html
diff --git a/LayoutTests/http/tests/geofencing/apis_not_implemented.html b/LayoutTests/http/tests/geofencing/apis_not_implemented.html
index 767a75e74da1c1e7ceb9ea31e8c4c3e4833fe876..5ed7185a633dca85229940b08d79d809237a7981 100644
--- a/LayoutTests/http/tests/geofencing/apis_not_implemented.html
+++ b/LayoutTests/http/tests/geofencing/apis_not_implemented.html
@@ -2,31 +2,9 @@
<title>Tests that all geofencing methods exposed on a service worker registration always reject.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/testharness-helpers.js"></script>
<script src="../serviceworker/resources/test-helpers.js"></script>
<script>
-// Copied from http/tests/serviceworker/resources/worker-test-harness.js, can be
-// removed once this makes it into testharness.js itself.
-function promise_test(func, name, properties) {
- properties = properties || {};
- var test = async_test(name, properties);
- Promise.resolve(test.step(func, test, test))
- .then(function() { test.done(); })
- .catch(test.step_func(function(value) {
- throw value;
- }));
-}
-function assert_promise_rejects(promise, code, description) {
- return promise.then(
- function() {
- throw 'assert_promise_rejects: ' + description + ' Promise did not throw.';
- },
- function(e) {
- if (code !== undefined) {
- assert_throws(code, function() { throw e; }, description);
- }
- });
-}
-
var sw_url = 'resources/emptyworker.js';
var sw_scope = '/service-worker-scope' + window.location.pathname;

Powered by Google App Engine
This is Rietveld 408576698