content/base/test/file_html_in_xhr.sjs
author Henri Sivonen <hsivonen@iki.fi>
Wed, 16 Nov 2011 09:38:51 +0200
changeset 81982 75ace50df0089eaffb8137850e0c49458cd890b7
permissions -rw-r--r--
Bug 651072 - Support HTML parsing in XMLHttpRequest. r=smaug.

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");');
  }
}