Changeset 264542 in webkit


Ignore:
Timestamp:
Jul 17, 2020, 3:57:05 PM (5 years ago)
Author:
Chris Dumez
Message:

Resync web-platform-tests/background-fetch from upstream
https://bugs.webkit.org/show_bug.cgi?id=214495

Reviewed by Geoffrey Garen.

Resync web-platform-tests/background-fetch from upstream 81de986322a0de90f2.

  • resources/import-expectations.json:
  • web-platform-tests/background-fetch/META.yml: Added.
  • web-platform-tests/background-fetch/OWNERS: Removed.
  • web-platform-tests/background-fetch/abort.https.window.html: Added.
  • web-platform-tests/background-fetch/abort.https.window.js: Added.

(backgroundFetchTest.async test):
(backgroundFetch.await.new.Promise.resolve.registration.onprogress.async event):

  • web-platform-tests/background-fetch/content-security-policy.https.window.html: Added.
  • web-platform-tests/background-fetch/content-security-policy.https.window.js:

(backgroundFetchTest):

  • web-platform-tests/background-fetch/credentials-in-url.https.window.js: Removed.
  • web-platform-tests/background-fetch/dangling-markup.https.window.js: Removed.
  • web-platform-tests/background-fetch/fetch-uploads.https.window.html: Added.
  • web-platform-tests/background-fetch/fetch-uploads.https.window.js: Added.

(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/fetch.https.window.html: Added.
  • web-platform-tests/background-fetch/fetch.https.window.js: Added.

(promise_test.async test):
(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/get-ids.https.window.html: Added.
  • web-platform-tests/background-fetch/get-ids.https.window.js: Added.

(promise_test.async test):
(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/get.https.window.html: Added.
  • web-platform-tests/background-fetch/get.https.window.js: Added.

(promise_test.async test):
(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/idlharness.https.any.html: Added.
  • web-platform-tests/background-fetch/idlharness.https.any.js: Added.
  • web-platform-tests/background-fetch/idlharness.https.any.worker.html: Added.
  • web-platform-tests/background-fetch/interfaces-worker.https-expected.txt: Removed.
  • web-platform-tests/background-fetch/interfaces-worker.https.html: Removed.
  • web-platform-tests/background-fetch/interfaces.html: Removed.
  • web-platform-tests/background-fetch/interfaces.worker.js: Removed.
  • web-platform-tests/background-fetch/match.https.window.html: Added.
  • web-platform-tests/background-fetch/match.https.window.js: Added.

(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.html: Added.
  • web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js:

(backgroundFetchTest):

  • web-platform-tests/background-fetch/port-blocking.https.window.html: Added.
  • web-platform-tests/background-fetch/port-blocking.https.window.js:

(backgroundFetchTest):

  • web-platform-tests/background-fetch/resources/feature-name.txt: Added.
  • web-platform-tests/background-fetch/resources/sw.js: Removed.
  • web-platform-tests/background-fetch/resources/upload.py: Added.

(main):

  • web-platform-tests/background-fetch/resources/utils.js:

(async getMessageFromServiceWorker.return.new.Promise):
(async getMessageFromServiceWorker):
(async registerAndActivateServiceWorker):
(backgroundFetchTest):
(async uniqueId):

  • web-platform-tests/background-fetch/resources/w3c-import.log:
  • web-platform-tests/background-fetch/service_workers/sw-abort.js: Added.

(async getFetchResult):

  • web-platform-tests/background-fetch/service_workers/sw-helpers.js: Added.

(sendMessageToDocument):
(cloneRegistration.deepCopy):
(cloneRegistration):

  • web-platform-tests/background-fetch/service_workers/sw-update-ui.js: Added.

(async updateUI):

  • web-platform-tests/background-fetch/service_workers/sw.js: Added.

(async getFetchResult):
(handleBackgroundFetchEvent.switch.async bind):

  • web-platform-tests/background-fetch/service_workers/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/w3c-import.log.
  • web-platform-tests/background-fetch/update-ui.https.window.html: Added.
  • web-platform-tests/background-fetch/update-ui.https.window.js: Added.

(backgroundFetchTest.async test):

  • web-platform-tests/background-fetch/w3c-import.log:
Location:
trunk/LayoutTests
Files:
28 added
8 deleted
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r264541 r264542  
     12020-07-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Resync web-platform-tests/background-fetch from upstream
     4        https://bugs.webkit.org/show_bug.cgi?id=214495
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Resync web-platform-tests/background-fetch from upstream 81de986322a0de90f2.
     9
     10        * resources/import-expectations.json:
     11        * web-platform-tests/background-fetch/META.yml: Added.
     12        * web-platform-tests/background-fetch/OWNERS: Removed.
     13        * web-platform-tests/background-fetch/abort.https.window.html: Added.
     14        * web-platform-tests/background-fetch/abort.https.window.js: Added.
     15        (backgroundFetchTest.async test):
     16        (backgroundFetch.await.new.Promise.resolve.registration.onprogress.async event):
     17        * web-platform-tests/background-fetch/content-security-policy.https.window.html: Added.
     18        * web-platform-tests/background-fetch/content-security-policy.https.window.js:
     19        (backgroundFetchTest):
     20        * web-platform-tests/background-fetch/credentials-in-url.https.window.js: Removed.
     21        * web-platform-tests/background-fetch/dangling-markup.https.window.js: Removed.
     22        * web-platform-tests/background-fetch/fetch-uploads.https.window.html: Added.
     23        * web-platform-tests/background-fetch/fetch-uploads.https.window.js: Added.
     24        (backgroundFetchTest.async test):
     25        * web-platform-tests/background-fetch/fetch.https.window.html: Added.
     26        * web-platform-tests/background-fetch/fetch.https.window.js: Added.
     27        (promise_test.async test):
     28        (backgroundFetchTest.async test):
     29        * web-platform-tests/background-fetch/get-ids.https.window.html: Added.
     30        * web-platform-tests/background-fetch/get-ids.https.window.js: Added.
     31        (promise_test.async test):
     32        (backgroundFetchTest.async test):
     33        * web-platform-tests/background-fetch/get.https.window.html: Added.
     34        * web-platform-tests/background-fetch/get.https.window.js: Added.
     35        (promise_test.async test):
     36        (backgroundFetchTest.async test):
     37        * web-platform-tests/background-fetch/idlharness.https.any.html: Added.
     38        * web-platform-tests/background-fetch/idlharness.https.any.js: Added.
     39        * web-platform-tests/background-fetch/idlharness.https.any.worker.html: Added.
     40        * web-platform-tests/background-fetch/interfaces-worker.https-expected.txt: Removed.
     41        * web-platform-tests/background-fetch/interfaces-worker.https.html: Removed.
     42        * web-platform-tests/background-fetch/interfaces.html: Removed.
     43        * web-platform-tests/background-fetch/interfaces.worker.js: Removed.
     44        * web-platform-tests/background-fetch/match.https.window.html: Added.
     45        * web-platform-tests/background-fetch/match.https.window.js: Added.
     46        (backgroundFetchTest.async test):
     47        * web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.html: Added.
     48        * web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js:
     49        (backgroundFetchTest):
     50        * web-platform-tests/background-fetch/port-blocking.https.window.html: Added.
     51        * web-platform-tests/background-fetch/port-blocking.https.window.js:
     52        (backgroundFetchTest):
     53        * web-platform-tests/background-fetch/resources/feature-name.txt: Added.
     54        * web-platform-tests/background-fetch/resources/sw.js: Removed.
     55        * web-platform-tests/background-fetch/resources/upload.py: Added.
     56        (main):
     57        * web-platform-tests/background-fetch/resources/utils.js:
     58        (async getMessageFromServiceWorker.return.new.Promise):
     59        (async getMessageFromServiceWorker):
     60        (async registerAndActivateServiceWorker):
     61        (backgroundFetchTest):
     62        (async uniqueId):
     63        * web-platform-tests/background-fetch/resources/w3c-import.log:
     64        * web-platform-tests/background-fetch/service_workers/sw-abort.js: Added.
     65        (async getFetchResult):
     66        * web-platform-tests/background-fetch/service_workers/sw-helpers.js: Added.
     67        (sendMessageToDocument):
     68        (cloneRegistration.deepCopy):
     69        (cloneRegistration):
     70        * web-platform-tests/background-fetch/service_workers/sw-update-ui.js: Added.
     71        (async updateUI):
     72        * web-platform-tests/background-fetch/service_workers/sw.js: Added.
     73        (async getFetchResult):
     74        (handleBackgroundFetchEvent.switch.async bind):
     75        * web-platform-tests/background-fetch/service_workers/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/w3c-import.log.
     76        * web-platform-tests/background-fetch/update-ui.https.window.html: Added.
     77        * web-platform-tests/background-fetch/update-ui.https.window.js: Added.
     78        (backgroundFetchTest.async test):
     79        * web-platform-tests/background-fetch/w3c-import.log:
     80
    1812020-07-17  Chris Dumez  <cdumez@apple.com>
    282
  • trunk/LayoutTests/imported/w3c/resources/import-expectations.json

    r264432 r264542  
    5151    "web-platform-tests/audio-output": "skip",
    5252    "web-platform-tests/auxclick": "skip",
     53    "web-platform-tests/background-fetch": "import",
    5354    "web-platform-tests/battery-status": "skip",
    5455    "web-platform-tests/beacon": "import",
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window.js

    r222307 r264542  
    1515
    1616backgroundFetchTest((t, bgFetch) => {
    17   return promise_rejects(
    18       t, new TypeError(),
    19       bgFetch.fetch(uniqueTag(), 'https://example.com'));
     17  return promise_rejects_js(
     18      t, TypeError,
     19      bgFetch.fetch(uniqueId(), 'https://example.com'));
    2020}, 'fetch blocked by CSP should reject');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js

    r230330 r264542  
    1616
    1717backgroundFetchTest((t, bgFetch) => {
    18   return bgFetch.fetch(uniqueTag(), 'https://example.com');
     18  return bgFetch.fetch(uniqueId(), 'https://example.com');
    1919}, 'https: fetch should register ok');
    2020
    2121backgroundFetchTest((t, bgFetch) => {
    22   return bgFetch.fetch(uniqueTag(), 'http://127.0.0.1');
     22  return bgFetch.fetch(uniqueId(), 'http://127.0.0.1');
    2323}, 'loopback IPv4 http: fetch should register ok');
    2424
    2525backgroundFetchTest((t, bgFetch) => {
    26   return bgFetch.fetch(uniqueTag(), 'http://[::1]');
     26  return bgFetch.fetch(uniqueId(), 'http://[::1]');
    2727}, 'loopback IPv6 http: fetch should register ok');
    2828
    2929backgroundFetchTest((t, bgFetch) => {
    30   return bgFetch.fetch(uniqueTag(), 'http://localhost');
     30  return bgFetch.fetch(uniqueId(), 'http://localhost');
    3131}, 'localhost http: fetch should register ok');
    3232
    3333backgroundFetchTest((t, bgFetch) => {
    34   return promise_rejects(t, new TypeError(),
    35                          bgFetch.fetch(uniqueTag(), 'http://example.com'));
    36 }, 'non-loopback http: fetch should reject');
    37 
    38 backgroundFetchTest((t, bgFetch) => {
    39   return promise_rejects(t, new TypeError(),
    40                          bgFetch.fetch(uniqueTag(), 'http://192.0.2.0'));
    41 }, 'non-loopback IPv4 http: fetch should reject');
    42 
    43 backgroundFetchTest((t, bgFetch) => {
    44   return promise_rejects(t, new TypeError(),
    45                          bgFetch.fetch(uniqueTag(), 'http://[2001:db8::1]'));
    46 }, 'non-loopback IPv6 http: fetch should reject');
    47 
    48 backgroundFetchTest((t, bgFetch) => {
    49   return promise_rejects(t, new TypeError(),
    50                          bgFetch.fetch(uniqueTag(), ['https://example.com',
    51                                                      'http://example.com']));
    52 }, 'https: and non-loopback http: fetch should reject');
    53 
    54 backgroundFetchTest((t, bgFetch) => {
    55   return promise_rejects(t, new TypeError(),
    56                          bgFetch.fetch(uniqueTag(), ['http://example.com',
    57                                                      'https://example.com']));
    58 }, 'non-loopback http: and https: fetch should reject');
    59 
    60 
    61 backgroundFetchTest((t, bgFetch) => {
    62   return promise_rejects(t, new TypeError(),
    63                          bgFetch.fetch(uniqueTag(), 'wss:127.0.0.1'));
     34  return promise_rejects_js(t, TypeError,
     35                         bgFetch.fetch(uniqueId(), 'wss:127.0.0.1'));
    6436}, 'wss: fetch should reject');
    6537
    6638backgroundFetchTest((t, bgFetch) => {
    67   return promise_rejects(t, new TypeError(),
    68                          bgFetch.fetch(uniqueTag(), 'file:///'));
     39  return promise_rejects_js(t, TypeError,
     40                         bgFetch.fetch(uniqueId(), 'file:///'));
    6941}, 'file: fetch should reject');
    7042
    7143backgroundFetchTest((t, bgFetch) => {
    72   return promise_rejects(t, new TypeError(),
    73                          bgFetch.fetch(uniqueTag(), 'data:text/plain,foo'));
     44  return promise_rejects_js(t, TypeError,
     45                         bgFetch.fetch(uniqueId(), 'data:text/plain,foo'));
    7446}, 'data: fetch should reject');
    7547
    7648backgroundFetchTest((t, bgFetch) => {
    77   return promise_rejects(t, new TypeError(),
    78                          bgFetch.fetch(uniqueTag(), 'foobar:bazqux'));
     49  return promise_rejects_js(t, TypeError,
     50                         bgFetch.fetch(uniqueId(), 'foobar:bazqux'));
    7951}, 'unknown scheme fetch should reject');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window.js

    r222307 r264542  
    1010
    1111backgroundFetchTest((t, bgFetch) => {
    12   return bgFetch.fetch(uniqueTag(), 'https://example.com');
     12  return bgFetch.fetch(uniqueId(), 'https://example.com');
    1313}, 'fetch to default https port should register ok');
    1414
    1515backgroundFetchTest((t, bgFetch) => {
    16   return bgFetch.fetch(uniqueTag(), 'http://127.0.0.1');
     16  return bgFetch.fetch(uniqueId(), 'http://127.0.0.1');
    1717}, 'fetch to default http port should register ok');
    1818
    1919backgroundFetchTest((t, bgFetch) => {
    20   return bgFetch.fetch(uniqueTag(), 'https://example.com:443');
     20  return bgFetch.fetch(uniqueId(), 'https://example.com:443');
    2121}, 'fetch to port 443 should register ok');
    2222
    2323backgroundFetchTest((t, bgFetch) => {
    24   return bgFetch.fetch(uniqueTag(), 'https://example.com:80');
     24  return bgFetch.fetch(uniqueId(), 'https://example.com:80');
    2525}, 'fetch to port 80 should register ok, even over https');
    2626
    2727backgroundFetchTest((t, bgFetch) => {
    28   return bgFetch.fetch(uniqueTag(), 'https://example.com:8080');
     28  return bgFetch.fetch(uniqueId(), 'https://example.com:8080');
    2929}, 'fetch to non-default non-bad port (8080) should register ok');
    3030
    3131backgroundFetchTest((t, bgFetch) => {
    32   return promise_rejects(
    33       t, new TypeError(),
    34       bgFetch.fetch(uniqueTag(), 'https://example.com:587'));
     32  return promise_rejects_js(
     33      t, TypeError,
     34      bgFetch.fetch(uniqueId(), 'https://example.com:587'));
    3535}, 'fetch to bad port (SMTP) should reject');
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/utils.js

    r222307 r264542  
    11'use strict';
    22
     3let nextBackgroundFetchId = 0;
     4
     5// Waits for a single message received from a registered Service Worker.
     6async function getMessageFromServiceWorker() {
     7  return new Promise(resolve => {
     8    function listener(event) {
     9      navigator.serviceWorker.removeEventListener('message', listener);
     10      resolve(event.data);
     11    }
     12
     13    navigator.serviceWorker.addEventListener('message', listener);
     14  });
     15}
     16
     17// Registers the |name| instrumentation Service Worker located at "service_workers/"
     18// with a scope unique to the test page that's running, and waits for it to be
     19// activated. The Service Worker will be unregistered automatically.
     20//
    321// Depends on /service-workers/service-worker/resources/test-helpers.sub.js
    4 async function registerAndActivateServiceWorker(test) {
    5   const script = 'resources/sw.js';
    6   const scope = 'resources/scope' + location.pathname;
     22async function registerAndActivateServiceWorker(test, name) {
     23  const script = `service_workers/${name}`;
     24  const scope = 'service_workers/scope' + location.pathname;
     25
    726  let serviceWorkerRegistration =
    827      await service_worker_unregister_and_register(test, script, scope);
    9   add_completion_callback(() => {
    10     serviceWorkerRegistration.unregister();
    11   });
     28
     29  add_completion_callback(() => serviceWorkerRegistration.unregister());
     30
    1231  await wait_for_state(test, serviceWorkerRegistration.installing, 'activated');
    1332  return serviceWorkerRegistration;
    1433}
    1534
    16 function backgroundFetchTest(func, description) {
     35// Creates a Promise test for |func| given the |description|. The |func| will be
     36// executed with the `backgroundFetch` object of an activated Service Worker
     37// Registration.
     38// |workerName| is the name of the service worker file in the service_workers
     39// directory to register.
     40function backgroundFetchTest(func, description, workerName = 'sw.js') {
    1741  promise_test(async t => {
    18     const serviceWorkerRegistration = await registerAndActivateServiceWorker(t);
     42    const serviceWorkerRegistration =
     43        await registerAndActivateServiceWorker(t, workerName);
     44    serviceWorkerRegistration.active.postMessage(null);
     45
     46    assert_equals(await getMessageFromServiceWorker(), 'ready');
     47
    1948    return func(t, serviceWorkerRegistration.backgroundFetch);
    2049  }, description);
    2150}
    2251
    23 let _nextBackgroundFetchTag = 0;
    24 function uniqueTag() {
    25   return 'tag' + _nextBackgroundFetchTag++;
     52// Returns a Background Fetch ID that's unique for the current page.
     53function uniqueId() {
     54  return 'id' + nextBackgroundFetchId++;
    2655}
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/w3c-import.log

    r222307 r264542  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    1515------------------------------------------------------------------------
    1616List of files:
    17 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/sw.js
     17/LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/feature-name.txt
     18/LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/upload.py
    1819/LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/utils.js
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/service_workers/w3c-import.log

    r264541 r264542  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    1515------------------------------------------------------------------------
    1616List of files:
    17 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/sw.js
    18 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/resources/utils.js
     17/LayoutTests/imported/w3c/web-platform-tests/background-fetch/service_workers/sw-abort.js
     18/LayoutTests/imported/w3c/web-platform-tests/background-fetch/service_workers/sw-helpers.js
     19/LayoutTests/imported/w3c/web-platform-tests/background-fetch/service_workers/sw-update-ui.js
     20/LayoutTests/imported/w3c/web-platform-tests/background-fetch/service_workers/sw.js
  • trunk/LayoutTests/imported/w3c/web-platform-tests/background-fetch/w3c-import.log

    r230330 r264542  
    22Do NOT modify these tests directly in WebKit.
    33Instead, create a pull request on the WPT github:
    4         https://github.com/w3c/web-platform-tests
     4        https://github.com/web-platform-tests/wpt
    55
    66Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
     
    1515------------------------------------------------------------------------
    1616List of files:
    17 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/OWNERS
     17/LayoutTests/imported/w3c/web-platform-tests/background-fetch/META.yml
     18/LayoutTests/imported/w3c/web-platform-tests/background-fetch/abort.https.window.js
    1819/LayoutTests/imported/w3c/web-platform-tests/background-fetch/content-security-policy.https.window.js
    19 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/credentials-in-url.https.window.js
    20 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/dangling-markup.https.window.js
    21 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/interfaces-worker.https.html
    22 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/interfaces.html
    23 /LayoutTests/imported/w3c/web-platform-tests/background-fetch/interfaces.worker.js
     20/LayoutTests/imported/w3c/web-platform-tests/background-fetch/fetch-uploads.https.window.js
     21/LayoutTests/imported/w3c/web-platform-tests/background-fetch/fetch.https.window.js
     22/LayoutTests/imported/w3c/web-platform-tests/background-fetch/get-ids.https.window.js
     23/LayoutTests/imported/w3c/web-platform-tests/background-fetch/get.https.window.js
     24/LayoutTests/imported/w3c/web-platform-tests/background-fetch/idlharness.https.any.js
     25/LayoutTests/imported/w3c/web-platform-tests/background-fetch/match.https.window.js
    2426/LayoutTests/imported/w3c/web-platform-tests/background-fetch/mixed-content-and-allowed-schemes.https.window.js
    2527/LayoutTests/imported/w3c/web-platform-tests/background-fetch/port-blocking.https.window.js
     28/LayoutTests/imported/w3c/web-platform-tests/background-fetch/update-ui.https.window.js
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r264532 r264542  
    971971
    972972# FIXME: This can't be the right bug number.
    973 webkit.org/b/175419 imported/w3c/web-platform-tests/background-fetch/interfaces-worker.https.html [ Failure ]
    974 webkit.org/b/175419 imported/w3c/web-platform-tests/background-fetch/interfaces.html [ Failure ]
    975973webkit.org/b/175419 imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https.html [ Failure Pass ]
    976974
Note: See TracChangeset for help on using the changeset viewer.