Update web-platform-tests to revision 66f38302334f162d363afcf4a1792d895072f3ef

This commit is contained in:
WPT Sync Bot 2018-06-13 21:09:34 -04:00
parent 36f5b69224
commit b198cd722a
622 changed files with 3374 additions and 2001 deletions

View file

@ -1,10 +1,11 @@
[createImageBitmap-drawImage.html]
type: testharness
expected: TIMEOUT
[createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap]
expected: FAIL
[createImageBitmap from a Blob, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap]
expected: FAIL
@ -46,10 +47,10 @@
expected: FAIL
[createImageBitmap from an ImageBitmap with negative sw/sh, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a Blob with negative sw/sh, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a bitmap HTMLImageElement, and drawImage on the created ImageBitmap]
expected: FAIL
@ -166,17 +167,17 @@
expected: FAIL
[createImageBitmap from an ImageBitmap scaled up, and drawImage on the created ImageBitmap]
expected: FAIL
expected: TIMEOUT
[createImageBitmap from an ImageBitmap resized, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a Blob scaled down, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a Blob scaled up, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN
[createImageBitmap from a Blob resized, and drawImage on the created ImageBitmap]
expected: FAIL
expected: NOTRUN

View file

@ -1,5 +1,6 @@
[idlharness.worker.html]
type: testharness
expected: ERROR
[ArrayBuffer interface: existence and properties of interface object]
expected: FAIL

File diff suppressed because it is too large Load diff

View file

@ -1,3 +0,0 @@
[c563-list-type-000.xht]
type: reftest
expected: FAIL

View file

@ -254,9 +254,6 @@
[Matching font-style: 'oblique -21deg' should prefer 'oblique 0deg' over 'oblique 30deg 60deg']
expected: FAIL
[Matching font-style: 'oblique -21deg' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg']
expected: FAIL
[Matching font-style: 'oblique 20deg' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg']
expected: FAIL

View file

@ -29,15 +29,6 @@
[Test @font-face matching for weight 1000]
expected: FAIL
[Test @font-face matching for weight 99]
expected: FAIL
[Test @font-face matching for weight 100]
expected: FAIL
[Test @font-face matching for weight 249]
expected: FAIL
[Test @font-face matching for weight 420]
expected: FAIL

View file

@ -0,0 +1,4 @@
[idlharness.html]
[CSS Painting API IDL tests]
expected: FAIL

View file

@ -0,0 +1,2 @@
[mq-case-insensitive-001.html]
expected: FAIL

View file

@ -927,3 +927,13 @@
[DOM IDL tests]
expected: FAIL
[interfaces.html?exclude=Node]
[DOM IDL tests]
expected: FAIL
[interfaces.html?include=Node]
[DOM IDL tests]
expected: FAIL

View file

@ -1,5 +0,0 @@
[javascript-url-return-value-handling.html]
type: testharness
[Test that javascript: evaluation only performs a navigation to the\n result when the result is a string value.]
expected: FAIL

View file

@ -5732,3 +5732,18 @@
[HTML IDL tests]
expected: FAIL
[interfaces.https.html?include=(Document|Window)]
[HTML IDL tests]
expected: FAIL
[interfaces.https.html?include=HTML.*]
[HTML IDL tests]
expected: FAIL
[interfaces.https.html?exclude=(Document|Window|HTML.*)]
[HTML IDL tests]
expected: FAIL

View file

@ -1,27 +1,5 @@
[self-origin.sub.html]
type: testharness
expected: TIMEOUT
[Should have the right origin for cross-origin subframe]
expected: NOTRUN
[Should have the right origin for cross-origin subframe after setting document.domain]
expected: NOTRUN
[Should have the right origin for IDN subframe]
expected: NOTRUN
[Should have the right origin for IDN subframe after setting document.domain]
expected: NOTRUN
[Should have the right origin for sandboxed iframe]
expected: NOTRUN
[about:blank subframe origins]
expected: FAIL
[blob: subframe origins]
expected: FAIL
[javascript: subframe origins]
expected: FAIL

View file

@ -172,36 +172,6 @@
[XHTML img usemap="http://example.org/#garbage-before-hash-id"]
expected: FAIL
[HTML (quirks) IMG usemap="no-hash-name"]
expected: FAIL
[HTML (quirks) IMG usemap="no-hash-id"]
expected: FAIL
[HTML (quirks) IMG usemap="hash-last#"]
expected: FAIL
[HTML (quirks) IMG usemap=""]
expected: FAIL
[HTML (quirks) IMG usemap="#"]
expected: FAIL
[HTML (quirks) IMG usemap="#percent-escape-name-%41"]
expected: FAIL
[HTML (quirks) IMG usemap="#percent-escape-id-%41"]
expected: FAIL
[HTML (quirks) IMG usemap="#no-such-map"]
expected: FAIL
[HTML (quirks) IMG usemap="#different-CASE-name"]
expected: FAIL
[HTML (quirks) IMG usemap="#different-CASE-id"]
expected: FAIL
[XHTML img usemap="no-hash-name"]
expected: FAIL
@ -232,3 +202,33 @@
[XHTML img usemap="#different-CASE-id"]
expected: FAIL
[HTML (standards) IMG usemap="no-hash-name"]
expected: FAIL
[HTML (standards) IMG usemap="no-hash-id"]
expected: FAIL
[HTML (standards) IMG usemap="hash-last#"]
expected: FAIL
[HTML (standards) IMG usemap=""]
expected: FAIL
[HTML (standards) IMG usemap="#"]
expected: FAIL
[HTML (standards) IMG usemap="#percent-escape-name-%41"]
expected: FAIL
[HTML (standards) IMG usemap="#percent-escape-id-%41"]
expected: FAIL
[HTML (standards) IMG usemap="#no-such-map"]
expected: FAIL
[HTML (standards) IMG usemap="#different-CASE-name"]
expected: FAIL
[HTML (standards) IMG usemap="#different-CASE-id"]
expected: FAIL

View file

@ -0,0 +1,5 @@
[context-release-upon-reload.html]
expected: TIMEOUT
[Overall test]
expected: NOTRUN

View file

@ -0,0 +1,5 @@
[context-release-with-workers.html]
expected: TIMEOUT
[Overall test]
expected: NOTRUN

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- nils-ohlmeier

View file

@ -1 +0,0 @@
@nils-ohlmeier

View file

@ -0,0 +1,6 @@
suggested_reviewers:
- AmeliaBR
- annevk
- kenrussell
- jdashg
- fserb

View file

@ -1,5 +0,0 @@
@AmeliaBR
@annevk
@kenrussell
@jdashg
@fserb

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- gsnedders

View file

@ -1 +0,0 @@
@gsnedders

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- beverloo

View file

@ -1 +0,0 @@
@beverloo

View file

@ -0,0 +1,5 @@
suggested_reviewers:
- inexorabletash
- zqzhang
- jdm
- mkruisselbrink

View file

@ -1,4 +0,0 @@
@inexorabletash
@zqzhang
@jdm
@mkruisselbrink

View file

@ -27,117 +27,6 @@
<div id="log"></div>
<pre id="untested_idl" style="display: none">
interface ArrayBuffer {
};
interface ArrayBufferView {
};
interface URL {
};
interface EventTarget {
};
interface Event {
};
[TreatNonCallableAsNull]
callback EventHandlerNonNull = any (Event event);
typedef EventHandlerNonNull? EventHandler;
</pre>
<pre id="idl" style="display: none">
[Constructor,
Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options), Exposed=Window,Worker]
interface Blob {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
//slice Blob into byte-ranged chunks
Blob slice([Clamp] optional long long start,
[Clamp] optional long long end,
optional DOMString contentType);
};
dictionary BlobPropertyBag {
DOMString type = "";
};
[Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits,
[EnsureUTF16] DOMString fileName, optional FilePropertyBag options), Exposed=Window,Worker]
interface File : Blob {
readonly attribute DOMString name;
readonly attribute long long lastModified;
};
dictionary FilePropertyBag {
DOMString type = "";
long long lastModified;
};
[Exposed=Window,Worker] interface FileList {
getter File? item(unsigned long index);
readonly attribute unsigned long length;
};
[Constructor, Exposed=Window,Worker]
interface FileReader: EventTarget {
// async read methods
void readAsArrayBuffer(Blob blob);
void readAsText(Blob blob, optional DOMString label);
void readAsDataURL(Blob blob);
void abort();
// states
const unsigned short EMPTY = 0;
const unsigned short LOADING = 1;
const unsigned short DONE = 2;
readonly attribute unsigned short readyState;
// File or Blob data
readonly attribute (DOMString or ArrayBuffer)? result;
readonly attribute DOMException? error;
// event handler attributes
attribute EventHandler onloadstart;
attribute EventHandler onprogress;
attribute EventHandler onload;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onloadend;
};
[Constructor, Exposed=Worker]
interface FileReaderSync {
// Synchronously return strings
ArrayBuffer readAsArrayBuffer(Blob blob);
DOMString readAsText(Blob blob, optional DOMString label);
DOMString readAsDataURL(Blob blob);
};
partial interface URL {
static DOMString createObjectURL(Blob blob);
static void revokeObjectURL(DOMString url);
};
</pre>
<script>
var fileInput;
@ -145,10 +34,18 @@ partial interface URL {
fileInput = document.querySelector("#fileChooser")
}, {explicit_done: true, explicit_timeout: true});
on_event(fileInput, "change", function(evt) {
var idl_array = new IdlArray();
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);
on_event(fileInput, "change", async function(evt) {
const idl = await fetch('/interfaces/FileAPI.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const url = await fetch('/interfaces/url.idl').then(r => r.text());
const idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(url);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
idl_array.add_objects({
FileList: [fileInput.files],

View file

@ -20,37 +20,30 @@
</form>
<script>
var file_input;
setup(function() {
var idl_array = new IdlArray();
'use strict';
var request = new XMLHttpRequest();
request.open("GET", "/interfaces/FileAPI.idl");
request.send();
request.onload = function() {
var idls = request.responseText;
promise_test(async () => {
const idl = await fetch('/interfaces/FileAPI.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const url = await fetch('/interfaces/url.idl').then(r => r.text());
const idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(url);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
idl_array.add_untested_idls("interface URL {};");
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget {};");
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface Event {};");
idl_array.add_untested_idls("[TreatNonCallableAsNull] callback EventHandlerNonNull = any (Event event);");
idl_array.add_untested_idls("typedef EventHandlerNonNull? EventHandler;");
idl_array.add_idls(idls);
file_input = document.querySelector("#fileChooser");
idl_array.add_objects({
Blob: ['new Blob(["TEST"])'],
File: ['new File(["myFileBits"], "myFileName")'],
FileList: ['file_input.files'],
FileList: ['document.querySelector("#fileChooser").files'],
FileReader: ['new FileReader()']
});
idl_array.test();
done();
};
}, {explicit_done: true});
}, 'Test FileAPI IDL implementation');
</script>
</body>

View file

@ -1,24 +1,18 @@
importScripts("/resources/testharness.js");
importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js");
var request = new XMLHttpRequest();
request.open("GET", "/interfaces/FileAPI.idl");
request.send();
request.onload = function() {
var idl_array = new IdlArray();
var idls = request.responseText;
idl_array.add_untested_idls("[Global] interface Window { };");
promise_test(async () => {
const idl = await fetch('/interfaces/FileAPI.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const url = await fetch('/interfaces/url.idl').then(r => r.text());
const idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(dom);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(url);
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
idl_array.add_untested_idls("interface URL {};");
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget {};");
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface Event {};");
idl_array.add_untested_idls("[TreatNonCallableAsNull] callback EventHandlerNonNull = any (Event event);");
idl_array.add_untested_idls("typedef EventHandlerNonNull? EventHandler;");
idl_array.add_idls(idls);
idl_array.add_objects({
Blob: ['new Blob(["TEST"])'],
File: ['new File(["myFileBits"], "myFileName")'],
@ -27,5 +21,5 @@ request.onload = function() {
});
idl_array.test();
done();
};
}, 'Test FileAPI IDL implementation');
done();

View file

@ -1,4 +1,9 @@
self.addEventListener('message', e => {
URL.revokeObjectURL(e.data.url);
// Registering a new object URL will make absolutely sure that the revocation
// has propagated. Without this at least in chrome it is possible for the
// below postMessage to arrive at its destination before the revocation has
// been fully processed.
URL.createObjectURL(new Blob([]));
self.postMessage('revoked');
});

View file

@ -0,0 +1,8 @@
suggested_reviewers:
- odinho
- inexorabletash
- chunywang
- dumbmatter
- zqzhang
- yunxiaoxie
- zhaozihao

View file

@ -1,7 +0,0 @@
@odinho
@inexorabletash
@chunywang
@dumbmatter
@zqzhang
@yunxiaoxie
@zhaozihao

View file

@ -47,7 +47,7 @@ For example, on most UNIX-like systems, you can setup the hosts file with:
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
python wpt make-hosts-file | Out-File $env:systemroot\System32\drivers\etc\hosts -Encoding ascii -Append
```
If you are behind a proxy, you also need to make sure the domains above are

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- Wafflespeanut
- jimsch
- engelke

View file

@ -1,3 +0,0 @@
@Wafflespeanut
@jimsch
@engelke

View file

@ -0,0 +1,5 @@
suggested_reviewers:
- domenic
- jensl
- tobie
- yuki3

View file

@ -1,4 +0,0 @@
@domenic
@jensl
@tobie
@yuki3

View file

@ -0,0 +1,7 @@
suggested_reviewers:
- zqzhang
- dontcallmedom
- riju
- Honry
- alexshalamov
- pozdnyakov

View file

@ -1,6 +0,0 @@
@zqzhang
@dontcallmedom
@riju
@Honry
@alexshalamov
@pozdnyakov

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- halindrome
- joanmarie

View file

@ -1,2 +0,0 @@
@halindrome
@joanmarie

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- Ms2ger

View file

@ -1 +0,0 @@
@Ms2ger

View file

@ -0,0 +1,8 @@
suggested_reviewers:
- zqzhang
- Volker-E
- dontcallmedom
- riju
- alexshalamov
- pozdnyakov
- Honry

View file

@ -1,7 +0,0 @@
@zqzhang
@Volker-E
@dontcallmedom
@riju
@alexshalamov
@pozdnyakov
@Honry

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- halindrome
- bigbluehat
- tcole3

View file

@ -1,3 +0,0 @@
@halindrome
@bigbluehat
@tcole3

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- halindrome

View file

@ -1 +0,0 @@
@halindrome

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- halindrome
- gkellogg

View file

@ -1,2 +0,0 @@
@halindrome
@gkellogg

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- stuartparmenter
- svgeesus
- leonscroggins

View file

@ -1,3 +0,0 @@
@stuartparmenter
@svgeesus
@leonscroggins

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- domenic

View file

@ -1 +0,0 @@
@domenic

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- guidou

View file

@ -1 +0,0 @@
@guidou

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- beverloo
- jakearchibald

View file

@ -1,2 +0,0 @@
@beverloo
@jakearchibald

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- anssiko
- dontcallmedom
- zqzhang

View file

@ -1,3 +0,0 @@
@anssiko
@dontcallmedom
@zqzhang

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- toddreifsteck
- igrigorik

View file

@ -1,2 +0,0 @@
@toddreifsteck
@igrigorik

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- jyasskin
- g-ortuno
- scheib

View file

@ -1,3 +0,0 @@
@jyasskin
@g-ortuno
@scheib

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- beverloo

View file

@ -1 +0,0 @@
@beverloo

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- mikewest
- msramek

View file

@ -1,2 +0,0 @@
@mikewest
@msramek

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- igrigorik
- yoavweiss
- tarunban

View file

@ -1,3 +0,0 @@
@igrigorik
@yoavweiss
@tarunban

View file

@ -0,0 +1,59 @@
<html>
<title>Accept-CH test</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=test>
<p>Apart from this webpage, the test opens another html web page. One test
is run in this web page, and another in the second web page.
</div>
<script>
// This test fetches resources/accept_ch.html. The response headers to
// that webpage contains only the Accept-CH header. Due to the missing
// Accept-CH-Lifetime header, the user-agent should not persist origin
// preferences for the client hints specified in Accept-CH header.
// Next, to verify that the origin preferences were not persisted by the user
// agent, this test fetches resources/do_not_expect_client_hints_headers.html
// in a new window. Fetching of
// resources/do_not_expect_client_hints_headers.html
// verifies that the user agent does not send the client hints in the request
// headers.
// Verify the initial state to make sure that the browser does not have client
// hints preferences cached from a previous run of the test.
// Test is marked as tentative until https://github.com/whatwg/fetch/issues/726
// is resolved.
promise_test(t => {
return fetch("echo_client_hints_received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser did not include client hints in the request
// headers when fetching echo_client_hints_received.py.
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
});
}, "Test that the browser does not have client hints preferences cached");
promise_test(t => {
return fetch("resources/accept_ch.html").then(r => {
assert_equals(r.status, 200)
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
// Open a new window.
window.open("resources/do_not_expect_client_hints_headers.html");
});
}, "Test receiving Accept-CH header");
async_test(t => {
window.addEventListener('message', function(event) {
t.done();
})
}, "Loading of resources/do_not_expect_client_hints_headers.html did not finish.");
</script>
</body>
</html>

View file

@ -0,0 +1,60 @@
<html>
<title>Accept-CH-Lifetime test</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=test>
<p>Apart from this webpage, the test opens another html web page. One test
is run in this web page, and another in the second web page.
</div>
<script>
// This test fetches resources/accept_ch_lifetime.html. The response headers to
// that webpage contain Accept-CH and Accept-CH-Lifetime headers.
// Fetching that webpage should cause the user-agent to persist origin
// preferences for the client hints specified in Accept-CH header for a
// duration specified in the Accept-CH-Lifetime header.
// Next, to verify if the origin preferences were persisted by the user
// agent, this test fetches resources/expect_client_hints_headers.html
// in a new window. Fetching of resources/expect_client_hints_headers.html
// verifies that the user agent actually sends the client hints in the request
// headers.
// Verify the initial state to make sure that the browser does not have client
// hints preferences cached from a previous run of the test.
// Test is marked as tentative until https://github.com/whatwg/fetch/issues/726
// is resolved.
promise_test(t => {
return fetch("echo_client_hints_received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser did not include client hints in the request
// headers when fetching echo_client_hints_received.py.
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
});
}, "Test that the browser does not have client hints preferences cached");
promise_test(t => {
return fetch("resources/accept_ch_lifetime.html").then(r => {
assert_equals(r.status, 200)
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
// Open a new window.
window.open("resources/expect_client_hints_headers.html");
});
}, "Test receiving Accept-CH-Lifetime header");
async_test(t => {
window.addEventListener('message', function(event) {
t.done();
})
}, "Loading of resources/expect_client_hints_headers.html did not finish.");
</script>
</body>
</html>

View file

@ -0,0 +1,10 @@
<html>
<body>
<!-- An empty webpage whose response headers include only the
Accept-CH header. Fetching this webpage should not cause
user-agent to persist origin preferences for the client hints
specified in the Accept-CH header.-->
</body>
</html>

View file

@ -0,0 +1 @@
Accept-CH: device-memory

View file

@ -0,0 +1,11 @@
<html>
<body>
<!-- An empty webpage whose response headers include Accept-CH
and Accept-CH-Lifetime header. Fetching this webpage should cause
user-agent to persist origin preferences for the client hints
specified in the Accept-CH header for a duration specified in
the Accept-CH-Lifetime header.-->
</body>
</html>

View file

@ -0,0 +1,2 @@
Accept-CH: device-memory
Accept-CH-Lifetime: 20

View file

@ -0,0 +1,28 @@
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// This test checks if browser attaches the device-memory client hint in the
// HTTP request headers.
// echo_client_hints_received.py sets the response headers depending on the set
// of client hints it receives in the request headers.
promise_test(t => {
return fetch("../echo_client_hints_received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser did not include client hints in the request
// headers when fetching echo_client_hints_received.py.
assert_false(r.headers.has("device-memory-received"), "device-memory-received");
window.top.opener.postMessage('PASS', '*');
});
}, "Test if device-memory header was not sent by the browser");
</script>
</body>
</html>

View file

@ -0,0 +1,28 @@
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// This test checks if browser attaches the device-memory client hint in the
// HTTP request headers.
// echo_client_hints_received.py sets the response headers depending on the set
// of client hints it receives in the request headers.
promise_test(t => {
return fetch("../echo_client_hints_received.py").then(r => {
assert_equals(r.status, 200)
// Verify that the browser included client hints in the request headers when
// fetching echo_client_hints_received.py.
assert_true(r.headers.has("device-memory-received"), "device-memory-received");
window.top.opener.postMessage('PASS', '*');
});
}, "Test if device-memory header was sent by the browser");
</script>
</body>
</html>

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- garykac
- hallvors

View file

@ -1,2 +0,0 @@
@garykac
@hallvors

View file

@ -0,0 +1,5 @@
suggested_reviewers:
- zqzhang
- dontcallmedom
- deniak
- gsnedders

View file

@ -1,4 +0,0 @@
@zqzhang
@dontcallmedom
@deniak
@gsnedders

View file

@ -0,0 +1,76 @@
// Only test a subset of tests with ?include=Foo or ?exclude=Foo in the URL.
// Can be used together with <meta name="variant" content="...">
// Sample usage:
// for (const test of tests) {
// subsetTestByKey("Foo", async_test, test.fn, test.name);
// }
(function() {
var subTestKeyPattern = null;
var match;
var collectKeys = false;
var collectCounts = false;
var keys = {};
var exclude = false;
if (location.search) {
match = /(?:^\?|&)(include|exclude)=([^&]+)?/.exec(location.search);
if (match) {
subTestKeyPattern = new RegExp(`^${match[2]}$`);
if (match[1] === 'exclude') {
exclude = true;
}
}
// Below is utility code to generate <meta> for copy/paste into tests.
// Sample usage:
// test.html?get-keys
match = /(?:^\?|&)get-keys(&get-counts)?(?:&|$)/.exec(location.search);
if (match) {
collectKeys = true;
if (match[1]) {
collectCounts = true;
}
add_completion_callback(() => {
var metas = [];
var template = '<meta name="variant" content="?include=%s">';
if (collectCounts) {
template += ' <!--%s-->';
}
for (var key in keys) {
var meta = template.replace("%s", key);
if (collectCounts) {
meta = meta.replace("%s", keys[key]);
}
metas.push(meta);
}
var pre = document.createElement('pre');
pre.textContent = metas.join('\n') + '\n';
document.body.insertBefore(pre, document.body.firstChild);
document.getSelection().selectAllChildren(pre);
});
}
}
function shouldRunSubTest(key) {
if (key && subTestKeyPattern) {
var found = subTestKeyPattern.test(key);
if (exclude) {
return !found;
}
return found;
}
return true;
}
function subsetTestByKey(key, testFunc, ...args) {
if (collectKeys) {
if (collectCounts && key in keys) {
keys[key]++;
} else {
keys[key] = 1;
}
}
if (shouldRunSubTest(key)) {
return testFunc(...args);
}
return null;
}
self.shouldRunSubTest = shouldRunSubTest;
self.subsetTestByKey = subsetTestByKey;
})();

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- cdumez
- foolip
- miketaylr

View file

@ -1,3 +0,0 @@
@cdumez
@foolip
@miketaylr

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- sideshowbarker

View file

@ -1 +0,0 @@
@sideshowbarker

View file

@ -0,0 +1,4 @@
suggested_reviewers:
- domenic
- pwnall
- domfarolino

View file

@ -1,3 +0,0 @@
@domenic
@pwnall
@domfarolino

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- hillbrad

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- bsittler
- pwnall

View file

@ -1,2 +0,0 @@
@bsittler
@pwnall

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- inikulin
- mikewest

View file

@ -1,2 +0,0 @@
@inikulin
@mikewest

View file

@ -0,0 +1,3 @@
suggested_reviewers:
- halindrome
- joanmarie

View file

@ -1,2 +0,0 @@
@halindrome
@joanmarie

View file

@ -0,0 +1,6 @@
suggested_reviewers:
- zqzhang
- odinho
- hillbrad
- jdm
- annevk

View file

@ -1,5 +0,0 @@
@zqzhang
@odinho
@hillbrad
@jdm
@annevk

View file

@ -0,0 +1,2 @@
suggested_reviewers:
- mikewest

Some files were not shown because too many files have changed in this diff Show more