Bug 1497320 [wpt PR 13371] - Revert "[Background Fetch] Add WPT tests for BackgroundFetchRegistration::abort", a=testonly
authorMarijn Kruisselbrink <mek@chromium.org>
Thu, 11 Oct 2018 09:30:26 +0000
changeset 441007 28e4a41b82890ca85a1bd557ef46d63813e339d5
parent 441006 0190c5793ffeeb0eec281cf377435c7a592415f3
child 441008 bf9667abba51109254ad238200f9ad5ae013e7b4
push id34842
push useraciure@mozilla.com
push dateSat, 13 Oct 2018 09:36:47 +0000
treeherdermozilla-central@94a62c1aad52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1497320, 13371, 35061, 1261477, 596723, 1262965, 596854
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497320 [wpt PR 13371] - Revert "[Background Fetch] Add WPT tests for BackgroundFetchRegistration::abort", a=testonly Automatic update from web-platform-testsRevert "[Background Fetch] Add WPT tests for BackgroundFetchRegistration::abort" This reverts commit c9bd394737bb75c77146870df92e636da8fe1ac6. Reason for revert: test is flaky in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.10%20Tests/35061 Original change's description: > [Background Fetch] Add WPT tests for BackgroundFetchRegistration::abort > > Simplify event dispatching code, and also allow for match/matchAll to be > called with the abort event. > > Change-Id: I3a9d17102f176f7c68131ea144e555a44ffd6ab1 > Reviewed-on: https://chromium-review.googlesource.com/c/1261477 > Commit-Queue: Rayan Kanso <rayankans@chromium.org> > Reviewed-by: Peter Beverloo <peter@chromium.org> > Reviewed-by: Mugdha Lakhani <nator@chromium.org> > Cr-Commit-Position: refs/heads/master@{#596723} TBR=peter@chromium.org,nator@chromium.org,rayankans@chromium.org Change-Id: I70bb246625c9d98707c6f61a91dc2dd658b1027f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/1262965 Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#596854} -- wpt-commits: b4c8ec5a1c8af91c237d80c380e178abe884a4d6 wpt-pr: 13371
testing/web-platform/tests/background-fetch/abort.https.window.js
testing/web-platform/tests/background-fetch/service_workers/sw.js
deleted file mode 100644
--- a/testing/web-platform/tests/background-fetch/abort.https.window.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
-// META: script=resources/utils.js
-'use strict';
-
-// Covers basic functionality provided by BackgroundFetchManager.abort().
-// https://wicg.github.io/background-fetch/#background-fetch-registration-abort
-
-backgroundFetchTest(async (test, backgroundFetch) => {
-  const registration = await backgroundFetch.fetch(
-      uniqueId(),
-      ['resources/feature-name.txt', '/serviceworker/resources/slow-response.php']);
-
-  assert_true(await registration.abort());
-  assert_false(await registration.abort());
-
-}, 'Aborting the same registration twice fails');
-
-backgroundFetchTest(async (test, backgroundFetch) => {
-  const registration = await backgroundFetch.fetch(
-      uniqueId(),
-      ['resources/feature-name.txt', '/serviceworker/resources/slow-response.php']);
-  const resultPromise = getMessageFromServiceWorker();
-
-  await new Promise(resolve => {
-    // Run the following steps after the first request is complete.
-    registration.onprogress = async () => {
-      assert_true(await registration.abort());
-
-      const {type, eventRegistration, results} = await resultPromise;
-
-      assert_equals(eventRegistration.result, 'failure');
-      assert_equals(eventRegistration.failureReason, 'aborted');
-
-      assert_equals(type, 'backgroundfetchabort');
-      assert_equals(results.length, 1);
-
-      assert_true(results[0].url.includes('resources/feature-name.txt'));
-      assert_equals(results[0].status, 200);
-      assert_equals(results[0].text, 'Background Fetch');
-
-      resolve();
-    };
-  });
-
-}, 'Calling BackgroundFetchRegistration.abort sets the correct fields and responses are still available');
\ No newline at end of file
--- a/testing/web-platform/tests/background-fetch/service_workers/sw.js
+++ b/testing/web-platform/tests/background-fetch/service_workers/sw.js
@@ -22,9 +22,8 @@ function handleBackgroundFetchUpdateEven
         const registrationCopy = cloneRegistration(event.registration);
         sendMessageToDocument(
           { type: event.type, eventRegistration: registrationCopy, results })
       }));
 }
 
 self.addEventListener('backgroundfetchsuccess', handleBackgroundFetchUpdateEvent);
 self.addEventListener('backgroundfetchfail', handleBackgroundFetchUpdateEvent);
-self.addEventListener('backgroundfetchabort', handleBackgroundFetchUpdateEvent);