Auto merge of #23010 - servo-wpt-sync:wpt_update_09-03-2019, r=jdm

Sync WPT with upstream (09-03-2019)

Automated downstream sync of changes from upstream as of 09-03-2019.
[no-wpt-sync]

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23010)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-09 23:25:07 -05:00 committed by GitHub
commit 7bdfad92a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 280 additions and 35 deletions

View file

@ -37,6 +37,3 @@
[Revoke blob URL after creating Request, will fetch]
expected: FAIL
[Revoke blob URL after calling fetch, fetch should succeed]
expected: FAIL

View file

@ -302677,6 +302677,11 @@
{}
]
],
"idle-detection/mock.js": [
[
{}
]
],
"imagebitmap-renderingcontext/META.yml": [
[
{}
@ -352163,6 +352168,12 @@
{}
]
],
"css/css-flexbox/intrinsic-width-overflow-auto.tentative.html": [
[
"css/css-flexbox/intrinsic-width-overflow-auto.tentative.html",
{}
]
],
"css/css-flexbox/order_value.html": [
[
"css/css-flexbox/order_value.html",
@ -396238,6 +396249,12 @@
}
]
],
"idle-detection/interceptor.https.html": [
[
"idle-detection/interceptor.https.html",
{}
]
],
"imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html": [
[
"imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html",
@ -578260,6 +578277,10 @@
"0220d79d901cca14324ea331d0ddfd9c086a08ee",
"manual"
],
"css/css-flexbox/intrinsic-width-overflow-auto.tentative.html": [
"8310e66cc4a2ef680d15f5c3ea56feb6edf4252e",
"testharness"
],
"css/css-flexbox/item-with-table-with-infinite-max-intrinsic-width.html": [
"f475db5bcffd1449be231da943cd1511b15e20b1",
"reftest"
@ -665480,6 +665501,14 @@
"4bda5c1a85b71e8fcb1c050710279bfec2919b68",
"testharness"
],
"idle-detection/interceptor.https.html": [
"03595afccdcd224f918f6e8baaf21c2419c24062",
"testharness"
],
"idle-detection/mock.js": [
"d88d1ad1c55afaee243e1e9146827b073c380613",
"support"
],
"imagebitmap-renderingcontext/META.yml": [
"f6a06f4e7d7625855e271ec5422629ca5e734560",
"support"
@ -666633,7 +666662,7 @@
"support"
],
"interfaces/mediasession.idl": [
"0fc9ff05f9475cd7f48fde6c22765d431b51310c",
"6fd5725dbb2975e724594629f0c2882477455caa",
"support"
],
"interfaces/mediastream-recording.idl": [

View file

@ -0,0 +1,7 @@
[intrinsic-width-overflow-auto.tentative.html]
[.flexbox 1]
expected: FAIL
[.flexbox 2]
expected: FAIL

View file

@ -149,9 +149,6 @@
[Matching font-style: 'oblique -21deg' should prefer 'oblique -21deg' over 'oblique -60deg -40deg']
expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'oblique -10deg' over 'italic']
expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'italic' over 'oblique 0deg']
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_3.html]
[traverse_the_history_5.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,10 +0,0 @@
[non-active-document.html]
[DOMParser]
expected: FAIL
[createHTMLDocument]
expected: FAIL
[<template>]
expected: FAIL

View file

@ -1,7 +0,0 @@
[toggleEvent.html]
[Calling open twice on 'details' fires only one toggle event]
expected: FAIL
[Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element]
expected: FAIL

View file

@ -1,2 +0,0 @@
[script-onerror-insertion-point-2.html]
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[DOMContentLoaded-defer.html]
[The end: DOMContentLoaded and defer scripts]
expected: FAIL

View file

@ -0,0 +1,4 @@
[iframe_005.html]
[document.write external script into iframe write back into parent]
expected: FAIL

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="author" title="Google" href="https://www.google.com/" />
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#intrinsic-sizes" />
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1865" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<body onload="checkLayout('.flexbox')">
<div class="flexbox" style="display: flex; width: min-content;" data-expected-width="0">
<div style="overflow: auto;">
<div style="width: 100px; height: 100px;"></div>
</div>
</div>
<div class="flexbox" style="display: flex; width: min-content;" data-expected-width="10">
<div style="overflow: auto; border: 5px solid;">
<div style="width: 100px; height: 100px;"></div>
</div>
</div>

View file

@ -0,0 +1,133 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/inexorabletash/idle-detection">
<title>Tests the Idle Detection API</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="/gen/mojo/public/mojom/base/string16.mojom.js"></script>
<script src="/gen/mojo/public/mojom/base/time.mojom.js"></script>
<script src="/gen/third_party/blink/public/platform/modules/idle/idle_manager.mojom.js"></script>
<script src="mock.js"></script>
<script>
'use strict';
promise_test(async t => {
// Basic test that expects navigator.idle.query() to call internally
// addMonitor, which in turn will return an ACTIVE state.
expect(addMonitor).andReturn((threshold, monitorPtr) => {
return Promise.resolve({
state: {
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.LOCKED
}
});
});
let status = await navigator.idle.query({threshold: 10});
assert_equals(status.state.user, "active");
assert_equals(status.state.screen, "locked");
}, 'query()');
promise_test(async t => {
// Verifies that an event is thrown when a change of state from IDLE to ACTIVE
// is detected.
expect(addMonitor).andReturn((threshold, monitorPtr) => {
t.step_timeout(() => {
monitorPtr.update({
user: UserIdleState.IDLE,
screen: ScreenIdleState.UNLOCKED
});
}, 0);
return Promise.resolve({
state: {
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.UNLOCKED
}
});
});
let monitor = await navigator.idle.query({threshold: 10});
await new EventWatcher(t, monitor, ["change"]).wait_for("change");
assert_equals(monitor.state.user, "idle");
assert_equals(monitor.state.screen, "unlocked");
}, 'updates once');
promise_test(async t => {
// Simulates the user being active, going idle and then going back active
// again.
expect(addMonitor).andReturn((threshold, monitorPtr) => {
// Updates the client once with the user idle.
t.step_timeout(() => {
monitorPtr.update({
user: UserIdleState.IDLE,
screen: ScreenIdleState.UNLOCKED
});
}, 0);
// Updates the client a second time with the user active.
t.step_timeout(() => {
monitorPtr.update({
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.UNLOCKED
});
}, 1);
return Promise.resolve({
state: {
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.UNLOCKED
}
});
});
let monitor = await navigator.idle.query({threshold: 10});
let watcher = new EventWatcher(t, monitor, ["change"]);
// waits for the first event.
await watcher.wait_for("change");
assert_equals(monitor.state.user, "idle");
// waits for the second event.
await watcher.wait_for("change");
assert_equals(monitor.state.user, "active");
}, 'updates twice');
promise_test(async t => {
// Simulates a locked screen.
expect(addMonitor).andReturn((threshold, monitorPtr) => {
return Promise.resolve({
state: {
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.LOCKED
}
});
});
let monitor = await navigator.idle.query({threshold: 10});
assert_equals(monitor.state.screen, "locked");
}, 'locked screen');
promise_test(async t => {
// Simulates the service becoming unavailable.
expect(addMonitor).andReturn((threshold, monitorPtr) => {
return new Promise((resolve, reject) => {
// leave the renderer deliberately hanging by not resolve()-ing.
});
});
let error = new Promise((resolve, reject) => {
navigator.idle.query({threshold: 10})
.then((e) => {reject("unexpected response :(")})
.catch((e) => {resolve(e.message)});
});
// simulates what happens when the service is unavailable.
close();
assert_equals(await error, "Idle detection not available");
}, "service unavailable");
</script>

View file

@ -0,0 +1,83 @@
/**
* This is a testing framework that enables us to test the user idle detection
* by intercepting the connection between the renderer and the browser and
* exposing a mocking API for tests.
*
* Usage:
*
* 1) Include <script src="mock.js"></script> in your file.
* 2) Set expectations
* expect(addMonitor).andReturn((threshold, monitorPtr, callback) => {
* // mock behavior
* })
* 3) Call navigator.idle.query()
*
* The mocking API is blink agnostic and is designed such that other engines
* could implement it too. Here are the symbols that are exposed to tests:
*
* - function addMonitor(): the main/only function that can be mocked.
* - function expect(): the main/only function that enables us to mock it.
* - function close(): disconnects the interceptor.
* - enum UserIdleState {IDLE, ACTIVE}: blink agnostic constants.
* - enum ScreenIdleState {LOCKED, UNLOCKED}: blink agnostic constants.
*/
class FakeIdleMonitor {
addMonitor(threshold, monitorPtr, callback) {
return this.handler.addMonitor(threshold, monitorPtr);
}
setHandler(handler) {
this.handler = handler;
return this;
}
setBinding(binding) {
this.binding = binding;
return this;
}
close() {
this.binding.close();
}
}
const UserIdleState = {};
const ScreenIdleState = {};
function addMonitor(threshold, monitorPtr, callback) {
throw new Error("expected to be overriden by tests");
}
async function close() {
interceptor.close();
}
function expect(call) {
return {
andReturn(callback) {
let handler = {};
handler[call.name] = callback;
interceptor.setHandler(handler);
}
}
}
function intercept() {
let result = new FakeIdleMonitor();
let binding = new mojo.Binding(blink.mojom.IdleManager, result);
let interceptor = new MojoInterfaceInterceptor(blink.mojom.IdleManager.name);
interceptor.oninterfacerequest = (e) => {
binding.bind(e.handle);
}
interceptor.start();
UserIdleState.ACTIVE = blink.mojom.UserIdleState.kActive;
UserIdleState.IDLE = blink.mojom.UserIdleState.kIdle;
ScreenIdleState.LOCKED = blink.mojom.ScreenIdleState.kLocked;
ScreenIdleState.UNLOCKED = blink.mojom.ScreenIdleState.kUnlocked;
result.setBinding(binding);
return result;
}
const interceptor = intercept();

View file

@ -22,6 +22,7 @@ enum MediaSessionAction {
"previoustrack",
"nexttrack",
"skipad",
"stop",
};
callback MediaSessionActionHandler = void();