summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/file_html_in_xhr.sjs
blob: 8f4075ae7cae96b00ef79d8043948dafe0917c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function handleRequest(request, response)
{
  response.setHeader("Content-Type", "text/javascript", false);
  if (request.queryString.indexOf("report") != -1) {
    if (getState("loaded") == "loaded") {
      response.write("ok(false, 'This script was not supposed to get fetched.'); continueAfterReport();");
    } else {
      response.write("ok(true, 'This script was not supposed to get fetched.'); continueAfterReport();");      
    }
  } else {
    setState("loaded", "loaded");
    response.write('document.documentElement.setAttribute("data-fail", "FAIL");');
  }
}