Teach XHR how to handle relative urls.
Hixie says window.URL may not exist yet in the sky specs, but I'm sure we'll need something like it. R=ojan@chromium.org, abarth@chromium.org Review URL: https://codereview.chromium.org/729913003
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
Running 1 tests
|
||||
ok 1 XMLHttpRequest should be able to fetch relative urls
|
||||
1 tests
|
||||
1 pass
|
||||
0 fail
|
||||
22
engine/src/flutter/tests/services/xhr-relative.sky
Normal file
22
engine/src/flutter/tests/services/xhr-relative.sky
Normal file
@@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<import src="../resources/chai.sky" />
|
||||
<import src="../resources/mocha.sky" />
|
||||
<import src="/sky/framework/xmlhttprequest.sky" as="XMLHttpRequest" />
|
||||
<script>
|
||||
describe('XMLHttpRequest', function() {
|
||||
this.enableTimeouts(false);
|
||||
|
||||
it('should be able to fetch relative urls', function(done) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = function() {
|
||||
// Also testing that "this" is set correctly in the onload callback.
|
||||
assert.equal(this.responseText, "This is data from the network.\n");
|
||||
done();
|
||||
};
|
||||
xhr.open("GET", "resources/pass.txt");
|
||||
xhr.send();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user