Auto merge of #13561 - mathieuh:request-constructor, r=jdm

Make Request throw less often (fixes #13457)

<!-- Please describe your changes on the following line: -->

---

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13457

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->

---

This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13561)

<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-02-23 17:54:40 -08:00 committed by GitHub
commit 3bf81c389b
6 changed files with 15 additions and 29 deletions

View file

@ -164191,7 +164191,7 @@
"testharness"
],
"fetch/api/request/request-error.html": [
"bfd03777a43be514a0839ab14f5206f486332fdb",
"ff308916884f69b3f4aa8f2017c4d9fe0caf0f00",
"testharness"
],
"fetch/api/request/request-headers.html": [
@ -164203,7 +164203,7 @@
"testharness"
],
"fetch/api/request/request-init-001.sub.html": [
"096424b40f6a21e989a6a5d8684b29ee8cbb963e",
"49bc4349b4e7a85d88cacd54227355aa986535f1",
"testharness"
],
"fetch/api/request/request-init-002.html": [

View file

@ -1,20 +1,10 @@
[request-init-001.sub.html]
type: testharness
[Check referrer init value of about:client and associated getter]
expected: FAIL
[Check referrer init value of and associated getter]
expected: FAIL
[Check referrerPolicy init value of and associated getter]
expected: FAIL
[Check referrer init value of http://test.url and associated getter]
expected: FAIL
[Check referrerPolicy init value of same-origin and associated getter]
expected: FAIL
[Check mode init value of navigate and associated getter]
expected: FAIL

View file

@ -2,7 +2,3 @@
type: testharness
[Request has arrayBuffer method]
expected: FAIL
[Check referrer attribute]
expected: FAIL

View file

@ -26,6 +26,11 @@
"Expect TypeError exception");
},"Input URL has credentials");
test(function() {
assert_throws(new TypeError() , function() { new Request("", {"mode" : "navigate"}); },
"Expect TypeError exception");
},"RequestInit's mode is navigate");
test(function() {
assert_throws(new TypeError() , function() { new Request("", {"referrer" : "http://:not a valid URL"}); },
"Expect TypeError exception");

View file

@ -49,8 +49,8 @@
"strict-origin-when-cross-origin"
]
};
var modes = {"givenValues" : ["same-origin", "no-cors", "cors", "navigate"],
"expectedValues" : ["same-origin", "no-cors", "cors", "same-origin"]
var modes = {"givenValues" : ["same-origin", "no-cors", "cors"],
"expectedValues" : ["same-origin", "no-cors", "cors"]
};
var credentials = {"givenValues" : ["omit", "same-origin", "include"],
"expectedValues" : ["omit", "same-origin", "include"]