mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Update web-platform-tests to revision 70df598b894bfa4a7122720608a3110cb25ceb42
This commit is contained in:
parent
7f495fdd61
commit
4334a9c855
111 changed files with 3428 additions and 315 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-002.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-003.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-005.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-006.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-008.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-009.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-010.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-011.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-012.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[parse-input-arguments-016.https.html]
|
||||
type: reftest
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/17852
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
[HTMLAreaElement.html]
|
||||
[alt on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[shape on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[referrerPolicy on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[download on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[coords on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[alt on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[rel on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[rel on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[ping on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[ping on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[referrerPolicy on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[download on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[coords on HTMLAreaElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[shape on HTMLAreaElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
[HTMLEmbedElement.html]
|
||||
[src on HTMLEmbedElement must enqueue an attributeChanged reaction when adding src content attribute]
|
||||
expected: FAIL
|
||||
|
||||
[height on HTMLEmbedElement must enqueue an attributeChanged reaction when adding height content attribute]
|
||||
expected: FAIL
|
||||
|
||||
[type on HTMLEmbedElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[type on HTMLEmbedElement must enqueue an attributeChanged reaction when adding type content attribute]
|
||||
expected: FAIL
|
||||
|
||||
[src on HTMLEmbedElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[width on HTMLEmbedElement must enqueue an attributeChanged reaction when adding width content attribute]
|
||||
expected: FAIL
|
||||
|
||||
[width on HTMLEmbedElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[height on HTMLEmbedElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[HTMLFieldSetElement.html]
|
||||
[name on HTMLFieldSetElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[name on HTMLFieldSetElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
[HTMLImageElement.html]
|
||||
[referrerPolicy on HTMLImageElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[referrerPolicy on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[decoding on HTMLImageElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[decoding on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
||||
[sizes on HTMLImageElement must enqueue an attributeChanged reaction when replacing an existing attribute]
|
||||
expected: FAIL
|
||||
|
||||
[sizes on HTMLImageElement must enqueue an attributeChanged reaction when adding a new attribute]
|
||||
expected: FAIL
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
|
||||
[single-byte-decoder.html?XMLHttpRequest]
|
||||
expected: CRASH
|
||||
expected: TIMEOUT
|
||||
[ISO-8859-2: iso_8859-2:1987 (XMLHttpRequest)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -55,12 +55,9 @@
|
|||
expected: FAIL
|
||||
|
||||
[windows-1252: iso_8859-1:1987 (XMLHttpRequest)]
|
||||
expected: FAIL
|
||||
|
||||
[windows-1254: iso_8859-9:1989 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: iso_8859-9 (XMLHttpRequest)]
|
||||
[windows-1254: iso_8859-9:1989 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: windows-1254 (XMLHttpRequest)]
|
||||
|
@ -87,9 +84,6 @@
|
|||
[windows-1255: cp1255 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1257: windows-1257 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: iso88599 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
|
@ -111,5 +105,59 @@
|
|||
[x-mac-cyrillic: x-mac-cyrillic (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1258: cp1258 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1253: x-cp1253 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1256: cp1256 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: iso88591 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: iso-8859-9 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: iso_8859-1 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: latin1 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: csisolatin5 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1257: x-cp1257 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: cp1254 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1253: windows-1253 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: iso8859-1 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1254: iso-ir-148 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: l1 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: iso-8859-1 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: iso-ir-100 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1252: us-ascii (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
[windows-1256: windows-1256 (XMLHttpRequest)]
|
||||
expected: TIMEOUT
|
||||
|
||||
|
||||
[single-byte-decoder.html?TextDecoder]
|
||||
|
|
|
@ -312,24 +312,12 @@
|
|||
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: */* text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: */* text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,6 +11,3 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%0C]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_1.html]
|
||||
[Multiple history traversals from the same task]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[traverse_the_history_5.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[focus.window.html]
|
||||
[focus]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[embedded-opener-remove-frame.html]
|
||||
[opener and "removed" embedded documents]
|
||||
expected: FAIL
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[non-active-document.html]
|
||||
[DOMParser]
|
||||
expected: FAIL
|
||||
|
||||
[createHTMLDocument]
|
||||
expected: FAIL
|
||||
|
||||
[<template>]
|
||||
expected: FAIL
|
||||
|
|
@ -12,3 +12,6 @@
|
|||
[Verifies the resolution of entry.startTime is at least 5 microseconds.]
|
||||
expected: TIMEOUT
|
||||
|
||||
[Verifies the resolution of performance.now() is at least 5 microseconds.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[005.html]
|
||||
expected: ERROR
|
||||
[dedicated worker in shared worker in dedicated worker]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence.")
|
||||
// 'inputArguments' property is a string, not a sequence.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': Invalid argument types.")
|
||||
// 'non-sense-type' is not a proper name of CSS properties.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ try {
|
|||
registerPaint('foo', class { paint() { } });
|
||||
registerPaint('foo', class { paint() { } });
|
||||
} catch(ex) {
|
||||
if (ex.name == "NotSupportedError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': A class with name:'foo' is already registered.")
|
||||
// 'foo' gets registered twice.
|
||||
if (ex.name == 'InvalidModificationError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ var testsPassed = false;
|
|||
try {
|
||||
registerPaint('', class { });
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The empty string is not a valid name.")
|
||||
// The empty string is not a valid name.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence.")
|
||||
// 'inputProperties' property is 42, not a sequence<DOMString>.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ try {
|
|||
a.prototype = undefined;
|
||||
registerPaint('foo5', a);
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' object on the class does not exist.")
|
||||
// The prototype object is undefined, not an object.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ try {
|
|||
b.prototype = 42;
|
||||
registerPaint('foo6', b);
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' property on the class is not an object.")
|
||||
// The prototype object is 42, not an object.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ var testsPassed = false;
|
|||
try {
|
||||
registerPaint('foo7', class { });
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype does not exist.")
|
||||
// 'paint' property doesn't exist on the prototype chain.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype is not a function.")
|
||||
// 'paint' property's value is 42, not a function.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': cannot convert to dictionary.")
|
||||
// 'contextOptions' property is 42, not a dictionary.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(-50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(-100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(-50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(-100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(100%);"></div>
|
||||
</div>
|
|
@ -228,6 +228,41 @@ promise_test(() => {
|
|||
});
|
||||
}, 'Re-attaching shadow host with adopted stylesheets work');
|
||||
|
||||
test(() => {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(":host { color: red; }");
|
||||
const host = document.createElement("div");
|
||||
let sr = host.attachShadow({mode: "open"});
|
||||
sr.adoptedStyleSheets = [sheet];
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies when connected");
|
||||
sheet.replaceSync(":host { color: blue; }");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 255)", "Style update applies when connected");
|
||||
}, 'Attaching a shadow root that already has adopted stylesheets work');
|
||||
|
||||
test(() => {
|
||||
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(":host([red]) { color: red; } :host(.blue) { color: blue; }");
|
||||
const host = document.createElement("div");
|
||||
host.toggleAttribute("red");
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "No style applies yet");
|
||||
|
||||
let sr = host.attachShadow({mode: "open"});
|
||||
sr.adoptedStyleSheets = [sheet];
|
||||
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies after adding style");
|
||||
document.body.removeChild(host);
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies after reattachment");
|
||||
host.toggleAttribute("red");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "Attribute updates to the element after reattachment apply");
|
||||
host.classList.toggle("blue");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 255)", "Class updates to the element after reattachment apply");
|
||||
|
||||
}, "Re-attaching shadow host and updating attributes work");
|
||||
|
||||
promise_test(() => {
|
||||
const plainSheet = new CSSStyleSheet();
|
||||
const redStyleSheetPromise = plainSheet.replace(redStyleTexts[0]);
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Custom Elements: CEReactions on HTMLAreaElement interface</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="assert" content="alt, coords, shape, target, download, ping, rel,
|
||||
referrerPolicy of HTMLAreaElement interface must have CEReactions">
|
||||
<meta name="help" content="https://html.spec.whatwg.org/#the-area-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/custom-elements-helpers.js"></script>
|
||||
<script src="./resources/reactions.js"></script>
|
||||
|
||||
<map name="yellow" id="map">
|
||||
</map>
|
||||
<img usemap="#yellow" src="/images/yellow.png" alt="yellow pic">
|
||||
|
||||
<script>
|
||||
|
||||
function getParentElement() {
|
||||
let map = document.getElementById('map');
|
||||
return map;
|
||||
}
|
||||
|
||||
function setAttributes(instance) {
|
||||
instance.setAttribute('href', '/images/yellow.png');
|
||||
}
|
||||
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'alt', 'alt', 'yellow pic',
|
||||
'yellow pic2', 'alt on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithParentNode(
|
||||
'coords', 'coords', '1, 1, 5, 5',
|
||||
'2, 2, 6, 6', 'coords on HTMLAreaElement', 'area',
|
||||
getParentElement, HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'shape', 'shape', 'rectangle',
|
||||
'default', 'shape on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => instance.setAttribute('coords', '1, 1, 5, 5'),
|
||||
HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'target', 'target', '_blank',
|
||||
'_top', 'target on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'download', 'download', 'pic1',
|
||||
'pic2', 'download on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'ping', 'ping', 'location.href',
|
||||
`${location.protocol}\/\/${location.host}`, 'ping on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'rel', 'rel', 'help',
|
||||
'noreferrer', 'rel on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'referrerPolicy', 'referrerpolicy', 'same-origin',
|
||||
'origin', 'referrerPolicy on HTMLAreaElement', 'area',
|
||||
getParentElement, instance => setAttributes(instance), HTMLAreaElement
|
||||
);
|
||||
|
||||
</script>
|
|
@ -1,7 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Custom Elements: CEReactions on HTMLButtonElement interface</title>
|
||||
<meta name="author" title="Zhang Xiaoyu" href="xiaoyux.zhang@intel.com">
|
||||
<meta name="assert" content=" autofocus, disabled, formAction, formEnctype, formMethod, formNoValidate, formTarget, name, type, value of HTMLButtonElement interface must have CEReactions">
|
||||
<meta name="assert" content=" autofocus, disabled, formAction, formEnctype,
|
||||
formMethod, formNoValidate, formTarget, name, type, value
|
||||
of HTMLButtonElement interface must have CEReactions">
|
||||
<meta name="help" content="https://html.spec.whatwg.org/#htmlbuttonelement">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
@ -16,60 +18,63 @@ function getParentElement(parentElementName) {
|
|||
return parentElement;
|
||||
}
|
||||
|
||||
testReflectBooleanAttribute('autofocus', 'autofocus', 'autofocus on HTMLButtonElement', 'button', HTMLButtonElement);
|
||||
testReflectBooleanAttribute('disabled', 'disabled', 'disabled on HTMLButtonElement', 'button', HTMLButtonElement);
|
||||
testReflectAttribute('name', 'name', 'intel', 'intel1', 'name on HTMLButtonElement', 'button', HTMLButtonElement);
|
||||
testReflectAttribute('value', 'value', 'HTML', 'CSS', 'value on HTMLButtonElement', 'button', HTMLButtonElement);
|
||||
testReflectAttributeWithParentNode('type', 'type', 'submit', 'reset', 'type on HTMLButtonElement', 'button', () => getParentElement('form'), HTMLButtonElement);
|
||||
testReflectAttrWithDepAttr('formAction', 'formaction', 'type', 'intel.asp', 'intel1.asp', 'submit', 'formAction on HTMLButtonElement', 'button', 'form', HTMLButtonElement);
|
||||
testReflectAttrWithDepAttr('formEnctype', 'formenctype', 'type', 'text/plain', 'multipart/form-data', 'submit', 'formEnctype on HTMLButtonElement', 'button', 'form', HTMLButtonElement);
|
||||
testReflectAttrWithDepAttr('formMethod', 'formmethod', 'type', 'get', 'post', 'submit', 'formMethod on HTMLButtonElement', 'button', 'form', HTMLButtonElement);
|
||||
testReflectAttrWithContentValuesAndDepAttr('formNoValidate', 'formnovalidate', 'type', true, '', false, null, 'submit', 'formNoValidate on HTMLButtonElement', 'button', 'form', HTMLButtonElement);
|
||||
testReflectAttrWithDepAttr('formTarget', 'formtarget', 'type', '_blank', '_self', 'submit', 'formTarget on HTMLButtonElement', 'button', 'form', HTMLButtonElement);
|
||||
|
||||
//In parent node, sub node's observeAttribute which depends another attribute can enqueue by changing attribute value
|
||||
//Test reflect attribute with content values and dependent attribute
|
||||
function testReflectAttrWithContentValuesAndDepAttr(jsAtName, coAtName, deAtName, jsAtValue1, coAtValue1, jsAtValue2, coAtValue2, deAtValue, name, elementName, pElementName, interfaceName) {
|
||||
var parentElement = document.createElement(pElementName);
|
||||
document.body.appendChild(parentElement);
|
||||
|
||||
test(() => {
|
||||
var element = define_build_in_custom_element([coAtName], interfaceName, elementName);
|
||||
var instance = document.createElement(elementName, { is: element.name });
|
||||
|
||||
assert_array_equals(element.takeLog().types(), ['constructed']);
|
||||
parentElement.appendChild(instance);
|
||||
assert_array_equals(element.takeLog().types(), ['connected']);
|
||||
instance.setAttribute(deAtName, deAtValue);
|
||||
instance[jsAtName] = jsAtValue1;
|
||||
var logEntries = element.takeLog();
|
||||
assert_array_equals(logEntries.types(), ['attributeChanged']);
|
||||
assert_attribute_log_entry(logEntries.last(), { name: coAtName, oldValue: null, newValue: coAtValue1, namespace: null });
|
||||
|
||||
}, name + ' must enqueue an attributeChanged reaction when adding a new attribute');
|
||||
|
||||
test(() => {
|
||||
var element = define_build_in_custom_element([coAtName], interfaceName, elementName);
|
||||
var instance = document.createElement(elementName, { is: element.name });
|
||||
parentElement.appendChild(instance);
|
||||
instance.setAttribute(deAtName, deAtValue);
|
||||
instance[jsAtName] = jsAtValue1;
|
||||
|
||||
assert_array_equals(element.takeLog().types(), ['constructed', 'connected', 'attributeChanged']);
|
||||
instance[jsAtName] = jsAtValue2;
|
||||
var logEntries = element.takeLog();
|
||||
assert_array_equals(logEntries.types(), ['attributeChanged']);
|
||||
assert_attribute_log_entry(logEntries.last(), { name: coAtName, oldValue: coAtValue1, newValue: coAtValue2, namespace: null });
|
||||
|
||||
}, name + ' must enqueue an attributeChanged reaction when replacing an existing attribute');
|
||||
|
||||
parentElement.parentNode.removeChild(parentElement);
|
||||
function setAttributes(instance) {
|
||||
instance.setAttribute('type', 'submit');
|
||||
}
|
||||
|
||||
//Package reflect attribute with dependent attribute
|
||||
function testReflectAttrWithDepAttr(jsAtName, coAtName, deAtName, jsAtValue1, jsAtValue2, deAtValue, name, elementName, pElementName, interfaceName) {
|
||||
testReflectAttrWithContentValuesAndDepAttr(jsAtName, coAtName, deAtName, jsAtValue1, jsAtValue1, jsAtValue2, jsAtValue2, deAtValue, name, elementName, pElementName, interfaceName);
|
||||
}
|
||||
testReflectBooleanAttribute(
|
||||
'autofocus', 'autofocus', 'autofocus on HTMLButtonElement',
|
||||
'button', HTMLButtonElement
|
||||
);
|
||||
testReflectBooleanAttribute(
|
||||
'disabled', 'disabled','disabled on HTMLButtonElement',
|
||||
'button', HTMLButtonElement
|
||||
);
|
||||
testReflectAttribute(
|
||||
'name', 'name', 'intel',
|
||||
'intel1', 'name on HTMLButtonElement', 'button',
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectAttribute(
|
||||
'value', 'value', 'HTML',
|
||||
'CSS', 'value on HTMLButtonElement', 'button',
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectAttributeWithParentNode(
|
||||
'type', 'type', 'submit',
|
||||
'reset', 'type on HTMLButtonElement', 'button',
|
||||
() => getParentElement('form'), HTMLButtonElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'formAction', 'formaction', 'intel.asp',
|
||||
'intel1.asp', 'formAction on HTMLButtonElement', 'button',
|
||||
() => getParentElement('form'), instance => setAttributes(instance),
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'formEnctype', 'formenctype', 'text/plain', 'multipart/form-data',
|
||||
'formEnctype on HTMLButtonElement', 'button', () => getParentElement('form'),
|
||||
instance => setAttributes(instance),
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'formMethod', 'formmethod', 'get',
|
||||
'post', 'formMethod on HTMLButtonElement', 'button',
|
||||
() => getParentElement('form'), instance => setAttributes(instance),
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectBooleanAttributeWithDependentAttributes(
|
||||
'formNoValidate', 'formnovalidate', 'formNoValidate on HTMLButtonElement',
|
||||
'button', () => getParentElement('form'),
|
||||
instance => setAttributes(instance),
|
||||
HTMLButtonElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'formTarget', 'formtarget', '_blank',
|
||||
'_self', 'formTarget on HTMLButtonElement', 'button',
|
||||
() => getParentElement('form'), instance => setAttributes(instance),
|
||||
HTMLButtonElement
|
||||
);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Custom Elements: CEReactions on HTMLEmbedElement interface</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="assert" content="src, type, width, height of
|
||||
HTMLEmbedElement interface must have CEReactions">
|
||||
<meta name="help" content="https://html.spec.whatwg.org/#the-embed-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/custom-elements-helpers.js"></script>
|
||||
<script src="./resources/reactions.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
testReflectAttribute(
|
||||
'src', 'src', '/media/movie_5.mp4',
|
||||
'/media/sound_5.mp3', 'src on HTMLEmbedElement', 'embed',
|
||||
HTMLEmbedElement
|
||||
);
|
||||
testReflectAttribute(
|
||||
'type', 'type', 'video/webm',
|
||||
'video/mp4', 'type on HTMLEmbedElement', 'embed',
|
||||
HTMLEmbedElement
|
||||
);
|
||||
testReflectAttribute(
|
||||
'width', 'width', '100',
|
||||
'120', 'width on HTMLEmbedElement', 'embed',
|
||||
HTMLEmbedElement
|
||||
);
|
||||
testReflectAttribute(
|
||||
'height', 'height', '100',
|
||||
'120', 'height on HTMLEmbedElement', 'embed',
|
||||
HTMLEmbedElement
|
||||
);
|
||||
|
||||
</script>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Custom Elements: CEReactions on HTMLFieldSetElement interface</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="assert" content="disabled, name of
|
||||
HTMLFieldSetElement interface must have CEReactions">
|
||||
<meta name="help" content="https://html.spec.whatwg.org/#the-fieldset-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/custom-elements-helpers.js"></script>
|
||||
<script src="./resources/reactions.js"></script>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
|
||||
function getParentElement() {
|
||||
let form = document.createElement("form");
|
||||
document.body.appendChild(form);
|
||||
return form;
|
||||
}
|
||||
|
||||
testReflectBooleanAttributeWithParentNode(
|
||||
'disabled', 'disabled', 'disabled on HTMLFieldSetElement',
|
||||
'fieldset', getParentElement, HTMLFieldSetElement
|
||||
);
|
||||
testReflectAttributeWithParentNode(
|
||||
'name', 'name', 'fieldset1',
|
||||
'fieldset2', 'name on HTMLFieldSetElement', 'fieldset',
|
||||
getParentElement, HTMLFieldSetElement
|
||||
);
|
||||
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Custom Elements: CEReactions on HTMLImageElement interface</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<meta name="assert" content="alt, src, srcset, sizes, crossOrigin, useMap,
|
||||
isMap, width, height, referrerPolicy, decoding of
|
||||
HTMLImageElement interface must have CEReactions">
|
||||
<meta name="help" content="https://html.spec.whatwg.org/#the-img-element">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../resources/custom-elements-helpers.js"></script>
|
||||
<script src="./resources/reactions.js"></script>
|
||||
|
||||
<map name="yellow"></map>
|
||||
<map name="green"></map>
|
||||
<a href="/" id="a">
|
||||
</a>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
function getParentElement() {
|
||||
return document.body;
|
||||
}
|
||||
|
||||
function setAttributes(instance) {
|
||||
instance.setAttribute('src', '/images/green-1x1.png');
|
||||
}
|
||||
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'alt', 'alt', 'image1',
|
||||
'image2', 'alt on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithParentNode(
|
||||
'src', 'src', '/images/green-1x1.png',
|
||||
'/images/green-2x2.png', 'src on HTMLImageElement', 'img',
|
||||
getParentElement, HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'srcset', 'srcset', '/images/green.png',
|
||||
'/images/green-2x2.png', 'srcset on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'sizes', 'sizes', '(max-width: 32px) 28px',
|
||||
'(max-width: 48px) 44px', 'sizes on HTMLImageElement', 'img',
|
||||
getParentElement, instance => {
|
||||
instance.setAttribute('src', '/images/green-1x1.png');
|
||||
instance.setAttribute('srcset', '/images/green-2x2.png 1x');
|
||||
}, HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'crossOrigin', 'crossorigin', 'use-credentials',
|
||||
'anonymous', 'crossOrigin on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'useMap', 'usemap', '#yellow',
|
||||
'#green', 'useMap on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectBooleanAttributeWithDependentAttributes(
|
||||
'isMap', 'ismap', 'isMap on HTMLImageElement',
|
||||
'img', () => { return document.getElementById('a') },
|
||||
instance => setAttributes(instance),
|
||||
HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'width', 'width', '1',
|
||||
'2', 'width on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'height', 'height', '1',
|
||||
'2', 'height on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'referrerPolicy', 'referrerpolicy', 'same-origin',
|
||||
'origin', 'referrerPolicy on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
testReflectAttributeWithDependentAttributes(
|
||||
'decoding', 'decoding', 'async',
|
||||
'sync', 'decoding on HTMLImageElement', 'img',
|
||||
getParentElement, instance => setAttributes(instance), HTMLImageElement
|
||||
);
|
||||
|
||||
</script>
|
||||
</body>
|
|
@ -168,6 +168,48 @@ function testReflectBooleanAttribute(jsAttributeName, contentAttributeName, name
|
|||
testReflectAttributeWithContentValues(jsAttributeName, contentAttributeName, true, '', false, null, name, elementName, interfaceName);
|
||||
}
|
||||
|
||||
function testReflectAttributeWithContentValuesAndDependentAttributes(jsAttributeName, contentAttributeName, validValue1, contentValue1, validValue2, contentValue2, name, elementName, getParentElement, setAttributes, interfaceName) {
|
||||
let parentElement = getParentElement();
|
||||
|
||||
test(() => {
|
||||
let element = define_build_in_custom_element([contentAttributeName], interfaceName, elementName);
|
||||
let instance = document.createElement(elementName, { is: element.name });
|
||||
|
||||
assert_array_equals(element.takeLog().types(), ['constructed']);
|
||||
parentElement.appendChild(instance);
|
||||
assert_array_equals(element.takeLog().types(), ['connected']);
|
||||
setAttributes(instance);
|
||||
instance[jsAttributeName] = validValue1;
|
||||
let logEntries = element.takeLog();
|
||||
assert_array_equals(logEntries.types(), ['attributeChanged']);
|
||||
assert_attribute_log_entry(logEntries.last(), { name: contentAttributeName, oldValue: null, newValue: contentValue1, namespace: null });
|
||||
|
||||
}, name + ' must enqueue an attributeChanged reaction when adding a new attribute');
|
||||
|
||||
test(() => {
|
||||
let element = define_build_in_custom_element([contentAttributeName], interfaceName, elementName);
|
||||
let instance = document.createElement(elementName, { is: element.name });
|
||||
parentElement.appendChild(instance);
|
||||
setAttributes(instance);
|
||||
instance[jsAttributeName] = validValue1;
|
||||
|
||||
assert_array_equals(element.takeLog().types(), ['constructed', 'connected', 'attributeChanged']);
|
||||
instance[jsAttributeName] = validValue2;
|
||||
let logEntries = element.takeLog();
|
||||
assert_array_equals(logEntries.types(), ['attributeChanged']);
|
||||
assert_attribute_log_entry(logEntries.last(), { name: contentAttributeName, oldValue: contentValue1, newValue: contentValue2, namespace: null });
|
||||
|
||||
}, name + ' must enqueue an attributeChanged reaction when replacing an existing attribute');
|
||||
}
|
||||
|
||||
function testReflectAttributeWithDependentAttributes(jsAttributeName, contentAttributeName, validValue1, validValue2, name, elementName, getParentElement, setAttributes, interfaceName) {
|
||||
testReflectAttributeWithContentValuesAndDependentAttributes(jsAttributeName, contentAttributeName, validValue1, validValue1, validValue2, validValue2, name, elementName, getParentElement, setAttributes, interfaceName);
|
||||
}
|
||||
|
||||
function testReflectBooleanAttributeWithDependentAttributes(jsAttributeName, contentAttributeName, name, elementName, getParentElement, setAttributes, interfaceName) {
|
||||
testReflectAttributeWithContentValuesAndDependentAttributes(jsAttributeName, contentAttributeName, true, '', false, null, name, elementName, getParentElement, setAttributes, interfaceName);
|
||||
}
|
||||
|
||||
function testReflectAttributeWithContentValuesAndParentNode(jsAttributeName, contentAttributeName, validValue1, contentValue1, validValue2, contentValue2, name, elementName, getParentElement, interfaceName) {
|
||||
let parentElement = getParentElement();
|
||||
|
||||
|
@ -203,6 +245,10 @@ function testReflectAttributeWithParentNode(jsAttributeName, contentAttributeNam
|
|||
testReflectAttributeWithContentValuesAndParentNode(jsAttributeName, contentAttributeName, validValue1, validValue1, validValue2, validValue2, name, elementName, getParentElement, interfaceName);
|
||||
}
|
||||
|
||||
function testReflectBooleanAttributeWithParentNode(jsAttributeName, contentAttributeName, name, elementName, getParentElement, interfaceName) {
|
||||
testReflectAttributeWithContentValuesAndParentNode(jsAttributeName, contentAttributeName, true, '', false, null, name, elementName, getParentElement, interfaceName);
|
||||
}
|
||||
|
||||
function testAttributeAdder(testFunction, name) {
|
||||
test(function () {
|
||||
var element = define_new_custom_element(['id']);
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
layout: page
|
||||
title: Writing Your Own Runner
|
||||
---
|
||||
|
||||
Most test runners have two stages: finding all tests, followed by
|
||||
executing them (or a subset thereof).
|
||||
|
||||
To find all tests in the repository, it is **strongly** recommended to
|
||||
use the included `wpt manifest` tool: the required behaviors are more
|
||||
complex than what are documented (especially when it comes to
|
||||
precedence of the various possibilities and some undocumented legacy
|
||||
ways to define test types), and hence its behavior should be
|
||||
considered the canonical definition of how to enumerate tests and find
|
||||
their type in the repository.
|
||||
|
||||
For test execution, please read the documentation for the various test types
|
||||
very carefully and then check your understanding on
|
||||
the [mailing list][public-test-infra] or [IRC][] ([webclient][web irc], join
|
||||
channel `#testing`). It's possible edge-case behavior isn't properly
|
||||
documented!
|
||||
|
||||
[public-test-infra]: https://lists.w3.org/Archives/Public/public-test-infra/
|
||||
[IRC]: irc://irc.w3.org:6667/testing
|
||||
[web irc]: http://irc.w3.org
|
|
@ -0,0 +1,114 @@
|
|||
---
|
||||
layout: page
|
||||
title: Running Tests from the Local System
|
||||
---
|
||||
|
||||
The tests are designed to be run from your local computer.
|
||||
|
||||
## System Setup
|
||||
|
||||
The test environment requires [Python 2.7+](http://www.python.org/downloads)
|
||||
(but not Python 3.x).
|
||||
|
||||
On Windows, be sure to add the Python directory (`c:\python2x`, by default) to
|
||||
your `%Path%` [Environment Variable](http://www.computerhope.com/issues/ch000549.htm),
|
||||
and read the [Windows Notes](#windows-notes) section below.
|
||||
|
||||
To get the tests running, you need to set up the test domains in your
|
||||
[`hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29%23Location_in_the_file_system).
|
||||
|
||||
The necessary content can be generated with `./wpt make-hosts-file`; on
|
||||
Windows, you will need to preceed the prior command with `python` or
|
||||
the path to the Python binary (`python wpt make-hosts-file`).
|
||||
|
||||
For example, on most UNIX-like systems, you can setup the hosts file with:
|
||||
|
||||
```bash
|
||||
./wpt make-hosts-file | sudo tee -a /etc/hosts
|
||||
```
|
||||
|
||||
And on Windows (this must be run in a PowerShell session with Administrator privileges):
|
||||
|
||||
```bash
|
||||
python wpt make-hosts-file | Out-File %SystemRoot%\System32\drivers\etc\hosts -Encoding ascii -Append
|
||||
```
|
||||
|
||||
If you are behind a proxy, you also need to make sure the domains above are
|
||||
excluded from your proxy lookups.
|
||||
|
||||
### Windows Notes
|
||||
|
||||
Generally Windows Subsystem for Linux will provide the smoothest user
|
||||
experience for running web-platform-tests on Windows.
|
||||
|
||||
The standard Windows shell requires that all `wpt` commands are prefixed
|
||||
by the Python binary i.e. assuming `python` is on your path the server is
|
||||
started using:
|
||||
|
||||
`python wpt serve`
|
||||
|
||||
## Via the browser
|
||||
|
||||
The test environment can then be started using
|
||||
|
||||
./wpt serve
|
||||
|
||||
This will start HTTP servers on two ports and a websockets server on
|
||||
one port. By default the web servers start on ports 8000 and 8443 and the other
|
||||
ports are randomly-chosen free ports. Tests must be loaded from the
|
||||
*first* HTTP server in the output. To change the ports,
|
||||
create a `config.json` file in the wpt root directory, and add
|
||||
port definitions of your choice e.g.:
|
||||
|
||||
```
|
||||
{
|
||||
"ports": {
|
||||
"http": [1234, "auto"],
|
||||
"https":[5678]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After your `hosts` file is configured, the servers will be locally accessible at:
|
||||
|
||||
http://web-platform.test:8000/<br>
|
||||
https://web-platform.test:8443/ *
|
||||
|
||||
This server has all the capabilities of the publicly-deployed version--see
|
||||
[Running the Tests from the Web][from-web].
|
||||
|
||||
\**See [Trusting Root CA](https://github.com/web-platform-tests/wpt/blob/master/README.md#trusting-root-ca)*
|
||||
|
||||
## Via the command line
|
||||
|
||||
Many tests can be automatically executed in a new browser instance using
|
||||
|
||||
./wpt run [browsername] [tests]
|
||||
|
||||
This will automatically load the tests in the chosen browser and extract the
|
||||
test results. For example to run the `dom/historical.html` tests in a local
|
||||
copy of Chrome:
|
||||
|
||||
./wpt run chrome dom/historical.html
|
||||
|
||||
Or to run in a specified copy of Firefox:
|
||||
|
||||
./wpt run --binary ~/local/firefox/firefox firefox dom/historical.html
|
||||
|
||||
For details on the supported products and a large number of other options for
|
||||
customising the test run:
|
||||
|
||||
./wpt run --help
|
||||
|
||||
Additional browser-specific documentation:
|
||||
|
||||
* [Chrome][chrome]
|
||||
|
||||
* [Chrome for Android][chrome android]
|
||||
|
||||
* [Safari][safari]
|
||||
|
||||
[from-web]: {{ site.baseurl }}{% link _running-tests/from-web.md %}
|
||||
[chrome]: {{ site.baseurl }}{% link _running-tests/chrome.md %}
|
||||
[chrome android]: {{ site.baseurl }}{% link _running-tests/chrome_android.md %}
|
||||
[safari]: {{ site.baseurl }}{% link _running-tests/safari.md %}
|
26
tests/wpt/web-platform-tests/docs/_running-tests/from-web.md
Normal file
26
tests/wpt/web-platform-tests/docs/_running-tests/from-web.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
layout: page
|
||||
title: Running Tests from the Web
|
||||
---
|
||||
|
||||
Tests that have been merged on GitHub are mirrored at [http://w3c-test.org/][w3c-test].
|
||||
[On properly-configured systems](from-local-system), local files may also be
|
||||
served from the URL [http://web-platform.test](http://web-platform.test).
|
||||
|
||||
For running multiple tests inside a browser, there is a test runner
|
||||
located at `/tools/runner/index.html`.
|
||||
|
||||
This allows all the tests, or those matching a specific prefix
|
||||
(e.g. all tests under `/dom/`) to be run. For testharness.js tests,
|
||||
the results will be automatically collected, while the runner
|
||||
provides a simple UI for manually comparing reftest rendering and
|
||||
running manual tests.
|
||||
|
||||
Note, however, it does not currently handle more complex reftests with
|
||||
more than one reference involved.
|
||||
|
||||
Because it runs entirely in-browser, this runner cannot deal with
|
||||
edge-cases like tests that cause the browser to crash or hang.
|
||||
|
||||
[w3c-test]: http://w3c-test.org
|
||||
[from-local-system]: {{ site.baseurl }}{% link _running-tests/from-local-system.md %}
|
|
@ -2,79 +2,17 @@
|
|||
layout: page
|
||||
title: Running Tests
|
||||
---
|
||||
In simple cases individual tests can be run by simply loading the page
|
||||
in a browser window. For running larger groups of tests, or running
|
||||
tests frequently, this is not a practical approach and several better
|
||||
options exist.
|
||||
|
||||
## From the Command Line
|
||||
The simplest way to run the tests is via the public website. More detail on
|
||||
that approach is available in [Running tests from the Web][from-web].
|
||||
|
||||
The simplest way to run tests is to use the `wpt run` command from the
|
||||
root of the repository. This will automatically load the tests in the
|
||||
chosen browser, and extract the test results. For example to run the
|
||||
`dom/historical.html` tests in a local copy of Chrome:
|
||||
Contributors who are interested in modifying and creating tests should refer to
|
||||
[Running Tests from the Local System][from-local-system].
|
||||
|
||||
./wpt run chrome dom/historical.html
|
||||
Advanced use cases may call for a customized method of executing the tests.
|
||||
Guidelines for writing a custom "runner" are available at [Writing Your Own
|
||||
Runner][custom-runner].
|
||||
|
||||
Or to run in a specified copy of Firefox:
|
||||
|
||||
./wpt run --binary ~/local/firefox/firefox firefox dom/historical.html
|
||||
|
||||
For details on the supported products and a large number of other options for
|
||||
customising the test run:
|
||||
|
||||
./wpt run --help
|
||||
|
||||
Additional browser-specific documentation:
|
||||
|
||||
* [Chrome][chrome]
|
||||
|
||||
* [Chrome for Android][chrome android]
|
||||
|
||||
* [Safari][safari]
|
||||
|
||||
## From Inside a Browser
|
||||
Tests that have been merged on GitHub are mirrored at [http://w3c-test.org/][w3c-test].
|
||||
|
||||
For running multiple tests inside a browser, there is a test runner
|
||||
located at `/tools/runner/index.html`.
|
||||
|
||||
This allows all the tests, or those matching a specific prefix
|
||||
(e.g. all tests under `/dom/`) to be run. For testharness.js tests,
|
||||
the results will be automatically collected, while the runner
|
||||
provides a simple UI for manually comparing reftest rendering and
|
||||
running manual tests.
|
||||
|
||||
Note, however, it does not currently handle more complex reftests with
|
||||
more than one reference involved.
|
||||
|
||||
Because it runs entirely in-browser, this runner cannot deal with
|
||||
edge-cases like tests that cause the browser to crash or hang.
|
||||
|
||||
## Writing Your Own Runner
|
||||
|
||||
Most test runners have two stages: finding all tests, followed by
|
||||
executing them (or a subset thereof).
|
||||
|
||||
To find all tests in the repository, it is **strongly** recommended to
|
||||
use the included `wpt manifest` tool: the required behaviors are more
|
||||
complex than what are documented (especially when it comes to
|
||||
precedence of the various possibilities and some undocumented legacy
|
||||
ways to define test types), and hence its behavior should be
|
||||
considered the canonical definition of how to enumerate tests and find
|
||||
their type in the repository.
|
||||
|
||||
For test execution, please read the documentation for the various test types
|
||||
very carefully and then check your understanding on
|
||||
the [mailing list][public-test-infra] or [IRC][] ([webclient][web irc], join
|
||||
channel `#testing`). It's possible edge-case behavior isn't properly
|
||||
documented!
|
||||
|
||||
|
||||
[chrome]: {{ site.baseurl }}{% link _running-tests/chrome.md %}
|
||||
[chrome android]: {{ site.baseurl }}{% link _running-tests/chrome_android.md %}
|
||||
[safari]: {{ site.baseurl }}{% link _running-tests/safari.md %}
|
||||
[public-test-infra]: https://lists.w3.org/Archives/Public/public-test-infra/
|
||||
[IRC]: irc://irc.w3.org:6667/testing
|
||||
[web irc]: http://irc.w3.org
|
||||
[w3c-test]: http://w3c-test.org
|
||||
[custom-runner]: {{ site.baseurl }}{% link _running-tests/custom-runner.md %}
|
||||
[from-web]: {{ site.baseurl }}{% link _running-tests/from-web.md %}
|
||||
[from-local-system]: {{ site.baseurl }}{% link _running-tests/from-local-system.md %}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
# Writing H2 Tests
|
||||
---
|
||||
layout: page
|
||||
title: Writing H2 Tests
|
||||
order: 2
|
||||
---
|
||||
|
||||
> <b>Important:</b> The HTTP/2.0 server requires you to have Python 2.7.10+
|
||||
and OpenSSL 1.0.2+. This is because HTTP/2.0 is negotiated using the
|
||||
[TLS ALPN](https://tools.ietf.org/html/rfc7301) extension, which is only supported in [OpenSSL 1.0.2](https://www.openssl.org/news/openssl-1.0.2-notes.html) and up.
|
||||
|
|
|
@ -96,92 +96,6 @@ recursively: `a/META.yml` will get notified for `a/foo.html` and
|
|||
If you want to be notified about changes to tests in a directory, feel
|
||||
free to add yourself to the META.yml file!
|
||||
|
||||
|
||||
## Local Setup
|
||||
|
||||
The tests are designed to be run from your local computer. The test
|
||||
environment requires [Python 2.7+](http://www.python.org/downloads) (but not Python 3.x).
|
||||
|
||||
On Windows, be sure to add the Python directory (`c:\python2x`, by default) to
|
||||
your `%Path%` [Environment Variable](http://www.computerhope.com/issues/ch000549.htm),
|
||||
and read the [Windows Notes](#windows-notes) section below.
|
||||
|
||||
To get the tests running, you need to set up the test domains in your
|
||||
[`hosts` file](http://en.wikipedia.org/wiki/Hosts_%28file%29%23Location_in_the_file_system).
|
||||
|
||||
The necessary content can be generated with `./wpt make-hosts-file`; on
|
||||
Windows, you will need to preceed the prior command with `python` or
|
||||
the path to the Python binary (`python wpt make-hosts-file`).
|
||||
|
||||
For example, on most UNIX-like systems, you can setup the hosts file with:
|
||||
|
||||
```bash
|
||||
./wpt make-hosts-file | sudo tee -a /etc/hosts
|
||||
```
|
||||
|
||||
And on Windows (this must be run in a PowerShell session with Administrator privileges):
|
||||
|
||||
```bash
|
||||
python wpt make-hosts-file | Out-File %SystemRoot%\System32\drivers\etc\hosts -Encoding ascii -Append
|
||||
```
|
||||
|
||||
If you are behind a proxy, you also need to make sure the domains above are
|
||||
excluded from your proxy lookups.
|
||||
|
||||
The test environment can then be started using
|
||||
|
||||
./wpt serve
|
||||
|
||||
This will start HTTP servers on two ports and a websockets server on
|
||||
one port. By default the web servers start on ports 8000 and 8443 and the other
|
||||
ports are randomly-chosen free ports. Tests must be loaded from the
|
||||
*first* HTTP server in the output. To change the ports,
|
||||
create a `config.json` file in the wpt root directory, and add
|
||||
port definitions of your choice e.g.:
|
||||
|
||||
```
|
||||
{
|
||||
"ports": {
|
||||
"http": [1234, "auto"],
|
||||
"https":[5678]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After your `hosts` file is configured, the servers will be locally accessible at:
|
||||
|
||||
http://web-platform.test:8000/<br>
|
||||
https://web-platform.test:8443/ *
|
||||
|
||||
\**See [Trusting Root CA](https://github.com/web-platform-tests/wpt/blob/master/README.md#trusting-root-ca)*
|
||||
|
||||
## Running tests automatically
|
||||
|
||||
The `wpt run` command provides a frontend for running tests automatically
|
||||
in various browsers. The general syntax is:
|
||||
|
||||
```
|
||||
wpt run [options] <product> [test paths]
|
||||
```
|
||||
|
||||
e.g. to run `dom/historical.html` in Firefox, the required command is:
|
||||
|
||||
```
|
||||
wpt run firefox dom/historical.html
|
||||
```
|
||||
|
||||
### Windows Notes
|
||||
|
||||
Generally Windows Subsystem for Linux will provide the smoothest user
|
||||
experience for running web-platform-tests on Windows.
|
||||
|
||||
The standard Windows shell requires that all `wpt` commands are prefixed
|
||||
by the Python binary i.e. assuming `python` is on your path the server is
|
||||
started using:
|
||||
|
||||
`python wpt serve`
|
||||
|
||||
|
||||
[web-platform]: https://platform.html5.org
|
||||
[test262]: https://github.com/tc39/test262
|
||||
[webgl]: https://github.com/KhronosGroup/WebGL
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
async_test(t => {
|
||||
const input = document.body.appendChild(document.createElement("input"));
|
||||
input.onfocus = t.step_func(() => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe")),
|
||||
frameW = frame.contentWindow;
|
||||
frameW.onfocus = t.unreached_func();
|
||||
frame.remove();
|
||||
frameW.focus();
|
||||
t.step_timeout(() => {
|
||||
assert_equals(document.activeElement, input);
|
||||
t.done();
|
||||
}, 100);
|
||||
});
|
||||
input.focus();
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
<!doctype html>
|
||||
<title>opener and "removed" embedded documents</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<iframe name=matchesastring></iframe>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.querySelector("iframe"),
|
||||
frameW = frame.contentWindow;
|
||||
frame.onload = t.step_func(() => {
|
||||
// Firefox and Chrome/Safari load differently
|
||||
if (frame.contentWindow.location.href === "about:blank") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Test bits
|
||||
assert_equals(frameW.opener, window, "opener before removal");
|
||||
|
||||
const openerDesc = Object.getOwnPropertyDescriptor(frameW, "opener"),
|
||||
openerGet = openerDesc.get;
|
||||
|
||||
assert_equals(openerGet(), window, "opener before removal via directly invoking the getter");
|
||||
frame.remove();
|
||||
assert_equals(frameW.opener, null, "opener after removal");
|
||||
assert_equals(openerGet(), null, "opener after removal via directly invoking the getter");
|
||||
|
||||
frameW.opener = null;
|
||||
assert_equals(openerGet(), null, "opener after setting it null via directly invoking the getter");
|
||||
const openerDescNull = Object.getOwnPropertyDescriptor(frameW, "opener");
|
||||
assert_not_equals(openerDescNull, openerDesc);
|
||||
assert_object_equals(openerDescNull, openerDesc);
|
||||
|
||||
frameW.opener = "immaterial";
|
||||
assert_equals(openerGet(), null, "opener after setting it \"immaterial\" via directly invoking the getter");
|
||||
const openerDescImmaterial = Object.getOwnPropertyDescriptor(frameW, "opener");
|
||||
assert_equals(openerDescImmaterial.value, "immaterial");
|
||||
assert_true(openerDescImmaterial.writable);
|
||||
assert_true(openerDescImmaterial.enumerable);
|
||||
assert_true(openerDescImmaterial.configurable);
|
||||
|
||||
t.done();
|
||||
});
|
||||
window.open("/common/blank.html", "matchesastring");
|
||||
});
|
||||
</script>
|
|
@ -1,3 +1,3 @@
|
|||
spec: http://www.mathml-association.org/MathMLinHTML5/
|
||||
spec: https://mathml-refresh.github.io/mathml-core/
|
||||
suggested_reviewers:
|
||||
- fred-wang
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
# MathML: Tests for the MathML in HTML5 implementation note
|
||||
# MathML: Tests for the MathML Core specification
|
||||
|
||||
This directory contains tests for the
|
||||
[MathML in HTML5 implementation note](http://www.mathml-association.org/MathMLinHTML5/)
|
||||
which is itself based on the
|
||||
[HTML5 W3C recommendation](https://www.w3.org/TR/html5/),
|
||||
on the [MathML3 W3C recommendation](https://www.w3.org/TR/MathML3/)
|
||||
and on the
|
||||
[Open Font Format 3](http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=66391) standard.
|
||||
|
||||
[MathML Core specification](https://mathml-refresh.github.io/mathml-core/).
|
||||
Many of the tests verify OpenType features and require specific Web fonts for
|
||||
that purpose. WOFF fonts are generated by scripts in the `tools/` folder using
|
||||
the Python API of
|
||||
|
|
|
@ -55,7 +55,7 @@ function _getNELResourceURL(subdomain, suffix) {
|
|||
*/
|
||||
|
||||
function getURLForResourceWithBasicPolicy(subdomain) {
|
||||
return _getNELResourceURL(subdomain, "pass.png?id="+reportID);
|
||||
return _getNELResourceURL(subdomain, "pass.png?id="+reportID+"&success_fraction=1.0");
|
||||
}
|
||||
|
||||
function fetchResourceWithBasicPolicy(subdomain) {
|
||||
|
@ -63,6 +63,11 @@ function fetchResourceWithBasicPolicy(subdomain) {
|
|||
return fetch(url, {mode: "no-cors"});
|
||||
}
|
||||
|
||||
function fetchResourceWithZeroSuccessFractionPolicy(subdomain) {
|
||||
const url = _getNELResourceURL(subdomain, "pass.png?id="+reportID+"&success_fraction=0.0");
|
||||
return fetch(url, {mode: "no-cors"});
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetches a resource whose headers define an include_subdomains NEL policy.
|
||||
*/
|
||||
|
|
|
@ -3,4 +3,4 @@ Cache-Control: no-store, no-cache, must-revalidate
|
|||
Cache-Control: post-check=0, pre-check=0, false
|
||||
Pragma: no-cache
|
||||
Report-To: { "group": "nel-group", "max_age": 10886400, "endpoints": [{ "url": "https://{{hosts[][www]}}:{{ports[https][0]}}/network-error-logging/support/report.py?op=put&reportID={{GET[id]}}" }] }
|
||||
NEL: {"report_to": "nel-group", "max_age": 10886400, "success_fraction": 1.0}
|
||||
NEL: {"report_to": "nel-group", "max_age": 10886400, "success_fraction": {{GET[success_fraction]}}}
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_fetch_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin + '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from sxg.cert_fetch_error for' +
|
||||
' navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_fetch_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-cert-not-found-on-alt-origin.sxg?navigation';
|
||||
const cert_url =
|
||||
alt_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is same as the reporting origin. So
|
||||
// the report must not be downgraded.
|
||||
type: "sxg.cert_fetch_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: cert_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "http.error",
|
||||
status_code: 404,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_fetch_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_parse_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-format.sxg?navigation';
|
||||
const cert_url =
|
||||
test_origin + '/signed-exchange/resources/invalid-cert-format.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from sxg.cert_parse_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_parse_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-format-on-alt-origin.sxg?navigation';
|
||||
const cert_url =
|
||||
alt_origin + '/signed-exchange/resources/invalid-cert-format.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is same as the reporting origin. So
|
||||
// the report must not be downgraded.
|
||||
type: "sxg.cert_parse_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: cert_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_parse_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_verification_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-validity-period-too-long.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html', 'location');
|
||||
assert_true(message.is_fallback, 'is_fallback');
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from ' +
|
||||
'sxg.cert_verification_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_verification_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-validity-period-too-long-cert-on-alt-origin.sxg?navigation';
|
||||
const cert_url = alt_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.cert_verification_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_verification_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed for navigation (zero success fraction)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithZeroSuccessFractionPolicy();
|
||||
const sxg_url =
|
||||
alt_origin + '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportExists(
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: cert_url
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
}
|
||||
), 'SXG error reporting must be downgraded when the cert URL is different ' +
|
||||
'from the reporting origin');
|
||||
assert_false(await reportExists(
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
}
|
||||
), 'Succeeded normal NEL report should not be sent when success fraction ' +
|
||||
'is zero.');
|
||||
}, 'SXG error report must be downgraded when the cert URL is different from ' +
|
||||
'the reporting origin. And succeeded normal NEL report should not be sent ' +
|
||||
' when success fraction is zero.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.invalid_integrity_header for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-integrity-header.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.invalid_integrity_header",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.invalid_integrity_header for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.mi_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-merkle-integrity-error.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
try {
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
if (message.is_fallback) {
|
||||
assert_unreached('Fallback redirect should not have happened');
|
||||
} else {
|
||||
assert_unreached('SXG should not have loaded');
|
||||
}
|
||||
} catch (e) {
|
||||
assert_equals(e, 'timeout');
|
||||
}
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.mi_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
}
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.mi_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,64 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.parse_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-format.sxg?navigation';
|
||||
try {
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
if (message.is_fallback) {
|
||||
assert_unreached('Fallback redirect should not have happened');
|
||||
} else {
|
||||
assert_unreached('SXG should not have loaded');
|
||||
}
|
||||
} catch (e) {
|
||||
assert_equals(e, 'timeout');
|
||||
}
|
||||
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.parse_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
cert_url: []
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.parse_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.signature_verification_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-sha256.sxg?navigation';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from ' +
|
||||
'sxg.signature_verification_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.signature_verification_error for navigation</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-sha256-cert-on-alt-origin.sxg?navigation';
|
||||
const cert_url = alt_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
const message = await openSXGInIframeAndWaitForMessage(t, sxg_url);
|
||||
assert_equals(message.location,
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html');
|
||||
assert_true(message.is_fallback);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.signature_verification_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.signature_verification_error for navigation.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_fetch_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin + '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?prefetch';
|
||||
const cert_url =
|
||||
test_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from ' +
|
||||
'sxg.cert_fetch_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_fetch_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-cert-not-found-on-alt-origin.sxg?prefetch';
|
||||
const cert_url =
|
||||
alt_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is same as the reporting origin. So
|
||||
// the report must not be downgraded.
|
||||
type: "sxg.cert_fetch_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: cert_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "http.error",
|
||||
status_code: 404,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_fetch_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_parse_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-format.sxg?prefetch';
|
||||
const cert_url =
|
||||
test_origin + '/signed-exchange/resources/invalid-cert-format.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from sxg.cert_parse_error for' +
|
||||
' prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_parse_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-format-on-alt-origin.sxg?prefetch';
|
||||
const cert_url =
|
||||
alt_origin + '/signed-exchange/resources/invalid-cert-format.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is same as the reporting origin. So
|
||||
// the report must not be downgraded.
|
||||
type: "sxg.cert_parse_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: cert_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_parse_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.cert_verification_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-validity-period-too-long.sxg?prefetch';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from ' +
|
||||
'sxg.cert_verification_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.cert_verification_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-validity-period-too-long-cert-on-alt-origin.sxg?prefetch';
|
||||
const cert_url = alt_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.cert_verification_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.cert_verification_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,67 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed for prefetch (zero success fraction)</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithZeroSuccessFractionPolicy();
|
||||
const sxg_url =
|
||||
alt_origin + '/signed-exchange/resources/sxg/sxg-cert-not-found.sxg?prefetch';
|
||||
const cert_url =
|
||||
test_origin + '/signed-exchange/resources/not_found_certfile.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportExists(
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
), 'SXG error reporting must be downgraded when the cert URL is different ' +
|
||||
'from the reporting origin');
|
||||
assert_false(await reportExists(
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
}
|
||||
), 'Succeeded normal NEL report should not be sent when success fraction ' +
|
||||
'is zero.');
|
||||
}, 'SXG error report must be downgraded when the cert URL is different from ' +
|
||||
'the reporting origin. And succeeded normal NEL report should not be sent ' +
|
||||
' when success fraction is zero.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.invalid_integrity_header for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-integrity-header.sxg?prefetch';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.invalid_integrity_header",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.invalid_integrity_header for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.mi_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-merkle-integrity-error.sxg?prefetch';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.mi_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
}
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.mi_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.parse_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-format.sxg?prefetch';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.parse_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
cert_url: []
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.parse_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.failed downgraded from sxg.signature_verification_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
const test_origin = get_host_info().HTTPS_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-sha256.sxg?prefetch';
|
||||
const cert_url = test_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
// The origin of this SXG's certURL is different from the reporting
|
||||
// origin. So the report must be downgraded.
|
||||
type: "sxg.failed",
|
||||
elapsed_time: 0,
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.failed downgraded from ' +
|
||||
'sxg.signature_verification_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<title>SXG reporting test of sxg.signature_verification_error for prefetch</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/network-error-logging/support/nel.sub.js"></script>
|
||||
<script src="../resources/sxg-util.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
const alt_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
|
||||
|
||||
nel_test(async t => {
|
||||
await fetchResourceWithBasicPolicy();
|
||||
const sxg_url =
|
||||
alt_origin +
|
||||
'/signed-exchange/resources/sxg/sxg-invalid-cert-sha256-cert-on-alt-origin.sxg?prefetch';
|
||||
const cert_url = alt_origin + '/signed-exchange/resources/127.0.0.1.sxg.pem.cbor';
|
||||
addPrefetch(sxg_url);
|
||||
assert_true(await reportsExist([
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "sxg",
|
||||
type: "sxg.signature_verification_error",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
sxg: {
|
||||
outer_url: sxg_url,
|
||||
inner_url:
|
||||
innerURLOrigin() + '/signed-exchange/resources/inner-url.html',
|
||||
cert_url: [cert_url]
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
{
|
||||
url: sxg_url,
|
||||
user_agent: navigator.userAgent,
|
||||
type: "network-error",
|
||||
body: {
|
||||
phase: "application",
|
||||
type: "ok",
|
||||
status_code: 200,
|
||||
referrer: location.href,
|
||||
},
|
||||
metadata: {
|
||||
content_type: "application/reports+json",
|
||||
},
|
||||
},
|
||||
]));
|
||||
}, 'SXG reporting test of sxg.signature_verification_error for prefetch.');
|
||||
</script>
|
||||
</body>
|
|
@ -7,6 +7,7 @@ inner_url_origin=https://127.0.0.1:8444
|
|||
# the fly.
|
||||
wpt_test_origin=https://web-platform.test:8444
|
||||
wpt_test_remote_origin=https://www1.web-platform.test:8444
|
||||
wpt_test_alt_origin=https://not-web-platform.test:8444
|
||||
cert_url_origin=$wpt_test_origin
|
||||
sxg_content_type='content-type: application/signed-exchange;v=b3'
|
||||
|
||||
|
@ -40,6 +41,22 @@ gen-signedexchange \
|
|||
-o sxg/sxg-location.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# A valid Signed Exchange. The origin of certUrl is the "alt" origin where NEL
|
||||
# policy is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $wpt_test_alt_origin/signed-exchange/resources/$certfile.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 168h \
|
||||
-o sxg/sxg-location-cert-on-alt-origin.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# A signed exchange of unsupported version.
|
||||
gen-signedexchange \
|
||||
-version 1b2 \
|
||||
|
@ -154,6 +171,38 @@ gen-signedexchange \
|
|||
-miRecordSize 100 \
|
||||
-ignoreErrors true
|
||||
|
||||
# certUrl is 404 and the origin of certUrl is different from the "alt" origin
|
||||
# where NEL policy is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $cert_url_origin/signed-exchange/resources/not_found_certfile.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 168h \
|
||||
-o sxg/sxg-cert-not-found.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# certUrl is 404 and the origin of certUrl is the "alt" origin where NEL policy
|
||||
# is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $wpt_test_alt_origin/signed-exchange/resources/not_found_certfile.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 168h \
|
||||
-o sxg/sxg-cert-not-found-on-alt-origin.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# certUrl is 404 and fallback URL is another signed exchange.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
|
@ -170,6 +219,38 @@ gen-signedexchange \
|
|||
-miRecordSize 100 \
|
||||
-ignoreErrors true
|
||||
|
||||
# certUrl is an invalid cert and the origin of certUrl is different from the
|
||||
# "alt" origin where NEL policy is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $cert_url_origin/signed-exchange/resources/invalid-cert-format.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 168h \
|
||||
-o sxg/sxg-invalid-cert-format.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# certUrl is an invalid cert and the origin of certUrl is the "alt" origin where
|
||||
# NEL policy is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $wpt_test_alt_origin/signed-exchange/resources/invalid-cert-format.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 168h \
|
||||
-o sxg/sxg-invalid-cert-format-on-alt-origin.sxg \
|
||||
-miRecordSize 100
|
||||
|
||||
# Nested signed exchange.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
|
@ -272,7 +353,56 @@ gen-signedexchange \
|
|||
-miRecordSize 100 \
|
||||
-ignoreErrors true
|
||||
|
||||
|
||||
|
||||
# Signed Exchange with payload integrity error.
|
||||
echo 'garbage' | cat sxg/sxg-location.sxg - >sxg/sxg-merkle-integrity-error.sxg
|
||||
|
||||
# An invalid signed exchange which integrity header is invalid.
|
||||
cat sxg/sxg-location.sxg |
|
||||
sed 's/digest\/mi-sha256-03/digest\/mi-sha256-xx/' \
|
||||
> sxg/sxg-invalid-integrity-header.sxg
|
||||
|
||||
# An invalid signed exchange which cert-sha256 is invalid.
|
||||
dummy_sha256=`echo "dummy" | openssl dgst -binary -sha256 | base64`
|
||||
cat sxg/sxg-location.sxg |
|
||||
sed "s/cert-sha256=\*[^*]*\*;/cert-sha256=*$dummy_sha256*;/" \
|
||||
> sxg/sxg-invalid-cert-sha256.sxg
|
||||
cat sxg/sxg-location-cert-on-alt-origin.sxg |
|
||||
sed "s/cert-sha256=\*[^*]*\*;/cert-sha256=*$dummy_sha256*;/" \
|
||||
> sxg/sxg-invalid-cert-sha256-cert-on-alt-origin.sxg
|
||||
|
||||
# An invalid signed exchange which validity period is too long.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $cert_url_origin/signed-exchange/resources/$certfile.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 300h \
|
||||
-o sxg/sxg-validity-period-too-long.sxg \
|
||||
-miRecordSize 100 \
|
||||
-ignoreErrors true
|
||||
|
||||
# An invalid signed exchange which validity period is too long. The origin of
|
||||
# certUrl is the "alt" origin where NEL policy is installed in reporting tests.
|
||||
gen-signedexchange \
|
||||
-version $sxg_version \
|
||||
-uri $inner_url_origin/signed-exchange/resources/inner-url.html \
|
||||
-status 200 \
|
||||
-content sxg-location.html \
|
||||
-certificate $certfile \
|
||||
-certUrl $wpt_test_alt_origin/signed-exchange/resources/$certfile.cbor \
|
||||
-validityUrl $inner_url_origin/signed-exchange/resources/resource.validity.msg \
|
||||
-privateKey $keyfile \
|
||||
-date 2018-04-01T00:00:00Z \
|
||||
-expire 300h \
|
||||
-o sxg/sxg-validity-period-too-long-cert-on-alt-origin.sxg \
|
||||
-miRecordSize 100 \
|
||||
-ignoreErrors true
|
||||
|
||||
rm -fr $tmpdir
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
This is an invalid certificate file.
|
|
@ -0,0 +1 @@
|
|||
Content-Type: application/cert-chain+cbor
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue