Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/responseURL.html

Issue 312493004: Introduce XMLHttpRequest.responseURL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/responseURL-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head></head>
3 <body>
4
5 <script src="/js-test-resources/js-test.js"></script>
6 <script>
7 description('Test XMLHttpRequest.responseURL');
8 window.jsTestIsAsync = true;
9
10 function get(url, type) {
11 return new Promise(function(resolve, reject) {
12 var xhr = new XMLHttpRequest();
13 window.responseURL = xhr.responseURL;
14 shouldBeEqualToString('responseURL', '');
15
16 xhr.open('GET', url);
17 xhr.responseType = type;
18 window.responseURL = xhr.responseURL;
19 shouldBeEqualToString('responseURL', '');
20
21 xhr.onreadystatechange = function() {
22 debug('xhr.readyState = ' + xhr.readyState + ': responseURL = ' + xh r.responseURL);
23 if (xhr.readyState === 4) {
24 resolve(xhr);
25 }
26 }
27 xhr.send();
28 });
29 }
30
31 get('resources/reply2.txt', 'text').then(function(xhr) {
32 window.status = xhr.status;
33 shouldBeEqualToString('status', '2000');
34 window.responseURL = xhr.responseURL;
35 shouldBeEqualToString('responseURL', 'http://127.0.0.1:8000/xmlhttprequest/r esources/reply2.txt');
36
37 return get('resources/redirect.php?url=reply2.xml', 'document');
38 }).then(function(xhr) {
39 window.status = xhr.status;
40 shouldBeEqualToString('status', '200');
41 window.responseURL = xhr.responseURL;
42 shouldBeEqualToString('responseURL', 'http://127.0.0.1:8000/xmlhttprequest/r esources/reply2.xml');
43
44 return get('resources/redirect.php?url=not-found.txt', 'text');
45 }).then(function(xhr) {
46 window.status = xhr.status;
47 shouldBeEqualToString('status', '404');
48 window.responseURL = xhr.responseURL;
49 shouldBeEqualToString('responseURL', 'http://127.0.0.1:8000/xmlhttprequest/r esources/not-found.txt');
50
51 xhr.open('GET', xhr.responseURL);
52 }).catch(function(reason) {
53 testFailed(String(reason));
54 }).then(finishJSTest, finishJSTest);
55
56 </script>
57 </body>
58 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/responseURL-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698