content/base/test/file_html_in_xhr.sjs
author Gregory Szorc <gps@mozilla.com>
Wed, 28 Jan 2015 13:37:00 -0800
branchMOBILE130_2012050817_RELBRANCH
changeset 120184 c9527b7c0b9a28a3f1209c9488fb16965ed051cd
parent 81982 75ace50df0089eaffb8137850e0c49458cd890b7
permissions -rw-r--r--
Close old release branch MOBILE130_2012050817_RELBRANCH

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