-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update web-platform-tests to revision dc5ac330e65f29e767d7ce86004be25…
…1aad321f6
- Loading branch information
WPT Sync Bot
committed
Mar 10, 2019
1 parent
169b8cf
commit ef0343b
Showing
15 changed files
with
280 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
tests/wpt/metadata/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
[intrinsic-width-overflow-auto.tentative.html] | |||
[.flexbox 1] | |||
expected: FAIL | |||
|
|||
[.flexbox 2] | |||
expected: FAIL | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
.../wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...interface/traverse_the_history_3.html.ini → ...interface/traverse_the_history_5.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
[traverse_the_history_3.html] | [traverse_the_history_5.html] | ||
[Multiple history traversals, last would be aborted] | [Multiple history traversals, last would be aborted] | ||
expected: FAIL | expected: FAIL | ||
|
|
10 changes: 0 additions & 10 deletions
10
...wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...wpt/metadata/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...a/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html.ini
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
tests/wpt/metadata/html/syntax/parsing/DOMContentLoaded-defer.html.ini
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
.../wpt/metadata/html/webappapis/dynamic-markup-insertion/document-write/iframe_005.html.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
[iframe_005.html] | |||
[document.write external script into iframe write back into parent] | |||
expected: FAIL | |||
|
21 changes: 21 additions & 0 deletions
21
tests/wpt/web-platform-tests/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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> |
133 changes: 133 additions & 0 deletions
133
tests/wpt/web-platform-tests/idle-detection/interceptor.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters