Index: LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
diff --git a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
index b863bbb5b08df5a6235e49399dab2c43c4ec0495..c4df888078ec3df7853796bf91ca1b8b14595198 100644 |
--- a/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
+++ b/LayoutTests/http/tests/serviceworker/resources/test-helpers.js |
@@ -20,3 +20,14 @@ function service_worker_test(url, description) { |
} |
}); |
} |
+ |
+// FIXME: Replace this with test.unreached_func(desc) once testharness.js is updated |
+// Use with unexpected event handlers or Promise rejection. |
+// E.g.: |
+// onbadevent = fail(t, 'Should only see good events'); |
+// Promise.then(...).catch(fail(t, 'Rejection is never fun')); |
+function unreached_func(test, desc) { |
+ return test.step_func(function() { |
+ assert_unreached(desc); |
+ }); |
+} |