Skip to content

Commit

Permalink
Bug 1366969 - fix some WPTs to not re-use the same 'valid once per se…
Browse files Browse the repository at this point in the history
…ssion' auth landing, which incorrectly causes test-failures. r=annevk

fix some WPTs to not re-use the same 'valid once per session' auth landing, which incorrectly causes test-failures.

Differential Revision: https://phabricator.services.mozilla.com/D22878
  • Loading branch information
wisniewskit committed Mar 12, 2019
1 parent acb1e04 commit 72b34f3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.

This file was deleted.

10 changes: 10 additions & 0 deletions testing/web-platform/tests/xhr/resources/auth10/auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import imp
import os

here = os.path.split(os.path.abspath(__file__))[0]

def main(request, response):
auth = imp.load_source("", os.path.join(here,
"..",
"authentication.py"))
return auth.main(request, response)
10 changes: 10 additions & 0 deletions testing/web-platform/tests/xhr/resources/auth11/auth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import imp
import os

here = os.path.split(os.path.abspath(__file__))[0]

def main(request, response):
auth = imp.load_source("", os.path.join(here,
"..",
"authentication.py"))
return auth.main(request, response)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
urlstart = 'www1.'+location.host + location.pathname.replace(/\/[^\/]*$/, '/')
client.withCredentials = true
user = token()
client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false, user, 'pass')
client.open("GET", location.protocol+'//'+urlstart + "resources/auth10/auth.py", false, user, 'pass')
client.setRequestHeader("x-user", user)
assert_throws("NetworkError", function(){ client.send(null) })
assert_equals(client.responseText, '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
var client = new XMLHttpRequest(),
urlstart = location.host + location.pathname.replace(/\/[^\/]*$/, '/'),
user = token()
client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false, user, 'pass')
client.open("GET", location.protocol+'//'+urlstart + "resources/auth11/auth.py", false, user, 'pass')
client.setRequestHeader("x-user", user)
client.send(null)
// Repeat request but *without* credentials in the open() call.
// Is the UA supposed to cache credentials from above request and use them? Yes.
client.open("GET", location.protocol+'//'+urlstart + "resources/auth1/auth.py", false)
client.open("GET", location.protocol+'//'+urlstart + "resources/auth11/auth.py", false)
client.setRequestHeader("x-user", user)
client.send(null)

Expand Down

0 comments on commit 72b34f3

Please sign in to comment.