mirror of
https://github.com/servo/servo.git
synced 2025-08-23 06:15:35 +01:00
Update web-platform-tests to revision 5e3ea8f49fee68c327388bfd1dd1375a8ce12a0e.
This commit is contained in:
parent
12195a5c4a
commit
bfb96b9448
1166 changed files with 35123 additions and 900 deletions
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Example with iframe that notifies containing document via cross document messaging</title>
|
||||
<script src="../testharness.js"></script>
|
||||
<script src="../testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Notifications From Tests Running In An IFRAME</h1>
|
||||
<p>A test is run inside an <tt>iframe</tt> with a same origin document. The
|
||||
containing document should receive messages via <tt>postMessage</tt>/
|
||||
<tt>onmessage</tt> as the tests progress inside the <tt>iframe</tt>. A single
|
||||
passing test is expected in the summary below.
|
||||
</p>
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
var t = async_test("Containing document receives messages");
|
||||
var start_received = false;
|
||||
var result_received = false;
|
||||
var completion_received = false;
|
||||
|
||||
// These are the messages that are expected to be seen while running the tests
|
||||
// in the IFRAME.
|
||||
var expected_messages = [
|
||||
t.step_func(
|
||||
function(message) {
|
||||
assert_equals(message.data.type, "start");
|
||||
assert_own_property(message.data, "properties");
|
||||
}),
|
||||
|
||||
t.step_func(
|
||||
function(message) {
|
||||
assert_equals(message.data.type, "test_state");
|
||||
assert_equals(message.data.test.status, message.data.test.NOTRUN);
|
||||
}),
|
||||
|
||||
t.step_func(
|
||||
function(message) {
|
||||
assert_equals(message.data.type, "result");
|
||||
assert_equals(message.data.test.status, message.data.test.PASS);
|
||||
}),
|
||||
|
||||
t.step_func(
|
||||
function(message) {
|
||||
assert_equals(message.data.type, "complete");
|
||||
assert_equals(message.data.tests.length, 1);
|
||||
assert_equals(message.data.tests[0].status,
|
||||
message.data.tests[0].PASS);
|
||||
assert_equals(message.data.status.status, message.data.status.OK);
|
||||
t.done();
|
||||
}),
|
||||
|
||||
t.unreached_func("Too many messages received")
|
||||
];
|
||||
|
||||
on_event(window,
|
||||
"message",
|
||||
function(message) {
|
||||
var handler = expected_messages.shift();
|
||||
handler(message);
|
||||
});
|
||||
</script>
|
||||
<iframe src="apisample6.html" style="display:none">
|
||||
<!-- apisample6 implements a file_is_test test. -->
|
||||
</iframe>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue