mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Allow setting withCredentials in synchronous XMLHttpRequest
closes #10839
This commit is contained in:
parent
09b2efc706
commit
f56bd3a6f3
4 changed files with 3 additions and 24 deletions
|
@ -1,5 +0,0 @@
|
|||
[send-authentication-basic-cors-not-enabled.htm]
|
||||
type: testharness
|
||||
[XMLHttpRequest: send() - "Basic" authenticated CORS requests with user name and password passed to open() (asserts failure)]
|
||||
expected: FAIL
|
||||
|
|
@ -16,15 +16,8 @@ function test_withCredentials(worker) {
|
|||
test(function() {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open("GET", "resources/delay.py?ms=1000", false)
|
||||
if (worker) {
|
||||
client.withCredentials = true
|
||||
assert_true(client.withCredentials, "set in OPEN state")
|
||||
} else {
|
||||
assert_throws("InvalidAccessError", function() {
|
||||
client.withCredentials = true
|
||||
})
|
||||
assert_false(client.withCredentials, "set in OPEN state")
|
||||
}
|
||||
client.withCredentials = true
|
||||
assert_true(client.withCredentials, "set in OPEN state")
|
||||
}, "setting on synchronous XHR")
|
||||
|
||||
async_test(function() {
|
||||
|
|
|
@ -17,12 +17,6 @@ var url = CROSSDOMAIN + 'resources/cors-cookie.py?ident='
|
|||
* widthCredentials
|
||||
*/
|
||||
// XXX Do some https tests here as well
|
||||
test(function () {
|
||||
var client = new XMLHttpRequest()
|
||||
client.open('GET', CROSSDOMAIN, false)
|
||||
assert_throws(null, function() { client.withCredentials = true; }, 'setting withCredentials')
|
||||
}, 'Setting withCredentials on a sync XHR object should throw')
|
||||
|
||||
async_test(function () {
|
||||
var id = new Date().getTime() + '_1',
|
||||
client = new XMLHttpRequest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue