blob: 9ddbb9b47722de442b3f4e1889eb7ce75acbc79c [file] [log] [blame]
<!doctype html>
<title>XMLHttpRequest: open() resolving URLs (multi-Window; 4; evil)</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
It's unclear what the pass condition should be for this test.
Firefox, Opera (Presto): terminate request with no further events when IFRAME is removed.
Chrome: completes request to readyState=4 but responseText is "" so it's pretty much terminated with an extra event for "DONE" state
Pass condition is now according to my suggested spec text in , if that's not accepted we'll have to amend this test
var test = async_test()
function init() {
test.step(function() {
var hasErrorEvent = false
var client = new self[0].XMLHttpRequest()
client.onreadystatechange = function() {
test.step(function() {
if(client.readyState == 4) {
assert_equals(client.responseText, "", "responseText is empty on inactive document error condition")
client.addEventListener('error', function(){
test.step(function() {
hasErrorEvent = true
assert_equals(client.readyState, 4, "readyState is 4 when error listener fires")
client.addEventListener('loadend', function(){
test.step(function() {
assert_true(hasErrorEvent, "should get an error event")
})"GET", "folder.txt")
<iframe src="resources/init.htm"></iframe>