Skip to content

Commit

Permalink
Update web-platform-tests to revision b382ac7192087da0a7439902e20be76…
Browse files Browse the repository at this point in the history
…ab7587ee8
  • Loading branch information
servo-wpt-sync committed Aug 11, 2018
1 parent 3e96a32 commit defee2a
Show file tree
Hide file tree
Showing 45 changed files with 632 additions and 176 deletions.
264 changes: 211 additions & 53 deletions tests/wpt/metadata/MANIFEST.json

Large diffs are not rendered by default.

@@ -0,0 +1,2 @@
[floats-in-table-caption-001.html]
expected: FAIL
@@ -0,0 +1,2 @@
[abspos-inline-007.xht]
expected: FAIL
@@ -0,0 +1,2 @@
[css3-text-line-break-opclns-050.html]
expected: FAIL
@@ -0,0 +1,2 @@
[css3-text-line-break-opclns-054.html]
expected: FAIL
@@ -0,0 +1,2 @@
[css3-text-line-break-opclns-059.html]
expected: FAIL
@@ -0,0 +1,2 @@
[css3-text-line-break-opclns-164.html]
expected: FAIL
@@ -0,0 +1,2 @@
[css3-text-line-break-opclns-165.html]
expected: FAIL
@@ -0,0 +1,2 @@
[vh_not_refreshing_on_chrome.html]
expected: FAIL
5 changes: 5 additions & 0 deletions tests/wpt/metadata/encoding/idlharness.any.js.ini
Expand Up @@ -29,3 +29,8 @@
[idlharness]
expected: FAIL


[idlharness.any.serviceworker.html]
[idlharness]
expected: FAIL

5 changes: 5 additions & 0 deletions tests/wpt/metadata/fetch/api/abort/general.any.js.ini
Expand Up @@ -31,3 +31,8 @@
[general]
expected: FAIL


[general.any.serviceworker.html]
[general]
expected: FAIL

5 changes: 5 additions & 0 deletions tests/wpt/metadata/fetch/api/idl.any.js.ini
Expand Up @@ -29,3 +29,8 @@
[idl]
expected: FAIL


[idl.any.serviceworker.html]
[idl]
expected: FAIL

Expand Up @@ -17,3 +17,8 @@
[idlharness]
expected: FAIL


[idlharness.tentative.any.serviceworker.html]
[idlharness]
expected: FAIL

5 changes: 5 additions & 0 deletions tests/wpt/metadata/hr-time/idlharness.any.js.ini
Expand Up @@ -17,3 +17,8 @@
[idlharness]
expected: FAIL


[idlharness.any.serviceworker.html]
[idlharness]
expected: FAIL

Expand Up @@ -172,63 +172,3 @@
[XHTML img usemap="http://example.org/#garbage-before-hash-id"]
expected: FAIL

[XHTML img usemap="#percent-escape-id-%41"]
expected: FAIL

[XHTML img usemap="#different-CASE-id"]
expected: FAIL

[HTML (quirks) IMG usemap="#"]
expected: FAIL

[XHTML img usemap="hash-last#"]
expected: FAIL

[HTML (quirks) IMG usemap="no-hash-id"]
expected: FAIL

[HTML (quirks) IMG usemap="no-hash-name"]
expected: FAIL

[HTML (quirks) IMG usemap="#no-such-map"]
expected: FAIL

[HTML (quirks) IMG usemap="hash-last#"]
expected: FAIL

[XHTML img usemap="no-hash-id"]
expected: FAIL

[HTML (quirks) IMG usemap="#different-CASE-name"]
expected: FAIL

[XHTML img usemap="#no-such-map"]
expected: FAIL

[XHTML img usemap="#percent-escape-name-%41"]
expected: FAIL

[XHTML img usemap="#"]
expected: FAIL

[HTML (quirks) IMG usemap="#different-CASE-id"]
expected: FAIL

[XHTML img usemap="#different-CASE-name"]
expected: FAIL

[XHTML img usemap=""]
expected: FAIL

[HTML (quirks) IMG usemap=""]
expected: FAIL

[HTML (quirks) IMG usemap="#percent-escape-name-%41"]
expected: FAIL

[HTML (quirks) IMG usemap="#percent-escape-id-%41"]
expected: FAIL

[XHTML img usemap="no-hash-name"]
expected: FAIL

Expand Up @@ -17,3 +17,8 @@
[It rethrows exceptions]
expected: FAIL


[queue-microtask-exceptions.any.serviceworker.html]
[queue-microtask-exceptions]
expected: FAIL

Expand Up @@ -41,3 +41,8 @@
[It interleaves with promises as expected]
expected: FAIL


[queue-microtask.any.serviceworker.html]
[queue-microtask]
expected: FAIL

5 changes: 5 additions & 0 deletions tests/wpt/metadata/performance-timeline/idlharness.any.js.ini
Expand Up @@ -26,3 +26,8 @@
[idlharness]
expected: FAIL


[idlharness.any.serviceworker.html]
[idlharness]
expected: FAIL

20 changes: 7 additions & 13 deletions tests/wpt/metadata/url/urlencoded-parser.any.js.ini
@@ -1,39 +1,33 @@
[urlencoded-parser.any.html]
[request.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL

[request.formData() with input: a&b&c]
expected: FAIL

[response.formData() with input: a=b&c=d]
expected: FAIL

[response.formData() with input: a&b&c]
expected: FAIL

[request.formData() with input: a=b&c=d]
[response.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL


[urlencoded-parser.any.worker.html]
[response.formData() with input: a&b&c]
expected: FAIL

[request.formData() with input: &&&a=b&&&&c=d&]
[request.formData() with input: a&b&c]
expected: FAIL

[request.formData() with input: _charset_=windows-1252&test=%C2x]
[request.formData() with input: a=b&c=d]
expected: FAIL

[request.formData() with input: a&b&c]
[response.formData() with input: &&&a=b&&&&c=d&]
expected: FAIL

[request.formData() with input: a=b&c=d]
[response.formData() with input: a=b&c=d&]
expected: FAIL

[response.formData() with input: &&&a=b&&&&c=d&]
[response.formData() with input: _charset_=windows-1252&test=%C2x]
expected: FAIL

[request.formData() with input: a=b&c=d&]
[response.formData() with input: a=b&c=d]
expected: FAIL

5 changes: 5 additions & 0 deletions tests/wpt/metadata/websockets/basic-auth.any.js.ini
Expand Up @@ -23,3 +23,8 @@
[HTTP basic authentication should work with WebSockets]
expected: FAIL


[basic-auth.any.serviceworker.html]
[basic-auth]
expected: FAIL

@@ -1,5 +1,5 @@
[xmlhttprequest-sync-default-feature-policy.sub.html]
expected: ERROR
expected: TIMEOUT
[Default "sync-xhr" feature policy ["*"\] allows same-origin iframes.]
expected: TIMEOUT

Expand Down
2 changes: 2 additions & 0 deletions tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini
@@ -0,0 +1,2 @@
[transition_calc_implicit.html]
expected: TIMEOUT

This file was deleted.

17 changes: 10 additions & 7 deletions tests/wpt/web-platform-tests/background-fetch/resources/utils.js
Expand Up @@ -14,14 +14,14 @@ async function getMessageFromServiceWorker() {
});
}

// Registers the instrumentation Service Worker located at "resources/sw.js"
// Registers the |name| instrumentation Service Worker located at "service_workers/"
// with a scope unique to the test page that's running, and waits for it to be
// activated. The Service Worker will be unregistered automatically.
//
// Depends on /service-workers/service-worker/resources/test-helpers.sub.js
async function registerAndActivateServiceWorker(test) {
const script = 'resources/sw.js';
const scope = 'resources/scope' + location.pathname;
async function registerAndActivateServiceWorker(test, name) {
const script = `service_workers/${name}`;
const scope = 'service_workers/scope' + location.pathname;

let serviceWorkerRegistration =
await service_worker_unregister_and_register(test, script, scope);
Expand All @@ -35,10 +35,13 @@ async function registerAndActivateServiceWorker(test) {
// Creates a Promise test for |func| given the |description|. The |func| will be
// executed with the `backgroundFetch` object of an activated Service Worker
// Registration.
function backgroundFetchTest(func, description) {
// |workerName| is the name of the service worker file in the service_workers
// directory to register.
function backgroundFetchTest(func, description, workerName = 'sw.js') {
promise_test(async t => {
const serviceWorkerRegistration = await registerAndActivateServiceWorker(t);
serviceWorkerRegistration.active.postMessage(null /* unused */);
const serviceWorkerRegistration =
await registerAndActivateServiceWorker(t, workerName);
serviceWorkerRegistration.active.postMessage(null);

assert_equals(await getMessageFromServiceWorker(), 'ready');

Expand Down
@@ -0,0 +1,12 @@
// The source to post setup and completion results to.
let source = null;

function sendMessageToDocument(msg) {
source.postMessage(msg);
}

// Notify the document that the SW is registered and ready.
self.addEventListener('message', event => {
source = event.source;
sendMessageToDocument('ready');
});
@@ -0,0 +1,22 @@
importScripts('sw-helpers.js');

async function updateUI(event) {
let updateParams = [];
switch (event.id) {
case 'update-once':
updateParams = [{title: 'Title1'}];
break;
case 'update-twice':
updateParams = [{title: 'Title1'}, {title: 'Title2'}];
break;
}

return Promise.all(updateParams.map(param => event.updateUI(param)))
.then(() => 'update success')
.catch(e => e.message);
}

self.addEventListener('backgroundfetched', event => {
event.waitUntil(updateUI(event)
.then(update => sendMessageToDocument({ type: event.type, update })))
});
@@ -1,4 +1,4 @@
let source = null;
importScripts('sw-helpers.js');

async function getFetchResult(settledFetch) {
if (!settledFetch.response)
Expand All @@ -11,14 +11,9 @@ async function getFetchResult(settledFetch) {
};
}

self.addEventListener('message', event => {
source = event.source;
source.postMessage('ready');
});

self.addEventListener('backgroundfetched', event => {
event.waitUntil(
event.fetches.values()
.then(fetches => Promise.all(fetches.map(fetch => getFetchResult(fetch))))
.then(results => source.postMessage({ type: event.type, results })));
.then(results => sendMessageToDocument({ type: event.type, results })));
});
@@ -0,0 +1,32 @@
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
// META: script=resources/utils.js
'use strict';

// Covers functionality provided by BackgroundFetchUpdateEvent.updateUI().
//
// https://wicg.github.io/background-fetch/#backgroundfetchupdateuievent

const swName = 'sw-update-ui.js';

backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'update-once';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);

const message = await getMessageFromServiceWorker();
assert_equals(message.update, 'update success');

}, 'Background Fetch updateUI resolves', swName);


backgroundFetchTest(async (test, backgroundFetch) => {
const registrationId = 'update-twice';
const registration =
await backgroundFetch.fetch(registrationId, 'resources/feature-name.txt');
assert_equals(registration.id, registrationId);

const message = await getMessageFromServiceWorker();
assert_equals(message.update, 'updateUI may only be called once.');

}, 'Background Fetch updateUI called twice fails', swName);
24 changes: 24 additions & 0 deletions tests/wpt/web-platform-tests/budget-api/idlharness.https.any.js
@@ -0,0 +1,24 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

'use strict';

// See https://wicg.github.io/budget-api/

idl_test(
['budget-api'],
['html'],
async idl_array => {
idl_array.add_objects({ BudgetService: ['navigator.budget'] });
if (self.Window) {
idl_array.add_objects({ Navigator: ['navigator'] });
} else {
idl_array.add_objects({ WorkerNavigator: ['navigator'] });
}
const budgetStates = await navigator.budget.getBudget();
if (budgetStates.length) {
self.budgetState = budgetStates[0];
idl_array.add_objects({ BudgetState: ['budgetState'] });
}
}
);

0 comments on commit defee2a

Please sign in to comment.