<html>
  <head>
    <meta http-equiv="x-ua-compatible" content="chrome=1" />
    <title>ChromeFrame keyevent test</title>
    <script type="text/javascript"
        src="chrome_frame_tester_helpers.js"></script>

    <script type="text/javascript">
      function ValidateUserAgent() {
        if (isRunningInMSIE()) {
          onFailure("FullTab_XMLHttpRequestTest", 1, "Failed");
        }

        SendXHRRequest();
      }

      function SendXHRRequest() {
        var xhr = getXHRObject();
        if (!xhr) {
          onFailure("FullTab_XMLHttpRequestTest", 1,
                    "Failed to get XHR object");
        }

        xhr.open("GET", "http://localhost:1337/echoheader?User-Agent", false);
        try {
          xhr.send(null);
          var pos = xhr.responseText.indexOf("chromeframe");
          if (pos >= 0) {
            appendStatus("Received user agent: " + xhr.responseText);
            onSuccess("FullTab_XMLHttpRequestTest", 1);
          } else {
            onFailure("FullTab_XMLHttpRequestTest", 1,
                      "Failed to find chromeframe in user agent.");
          }
        } catch (e) {
          appendStatus("XHR send failed. Error: " + e.description);
          onFailure("FullTab_XMLHttpRequestTest", 1,
                    "Failed to send XHR request");
        }
      }
    </script>
  </head>

  <body onLoad="setTimeout(ValidateUserAgent, 100);">
    ChromeFrame full tab mode XMLHttpRequest test. Verifies that
    XMLHttpRequests use the host network stack.
  </body>
</html>

<html>
  <head>
    <meta http-equiv="x-ua-compatible" content="chrome=1" />
    <title>ChromeFrame keyevent test</title>
    <script type="text/javascript"
        src="chrome_frame_tester_helpers.js"></script>

    <script type="text/javascript">
      function ValidateUserAgent() {
        if (isRunningInMSIE()) {
          onFailure("FullTab_XMLHttpRequestTest", 1, "Failed");
        }

        SendXHRRequest();
      }

      function SendXHRRequest() {
        var xhr = getXHRObject();
        if (!xhr) {
          onFailure("FullTab_XMLHttpRequestTest", 1,
                    "Failed to get XHR object");
        }

        var url = GetBaseUrlPath() + "echoheader?User-Agent";
        xhr.open("GET", url, false);
        try {
          xhr.send(null);
          var pos = xhr.responseText.indexOf("chromeframe");
          if (pos >= 0) {
            appendStatus("Received user agent: " + xhr.responseText);
            onSuccess("FullTab_XMLHttpRequestTest", 1);
          } else {
            onFailure("FullTab_XMLHttpRequestTest", 1,
                      "Failed to find chromeframe in user agent.");
          }
        } catch (e) {
          appendStatus("XHR send failed. Error: " + e.description);
          onFailure("FullTab_XMLHttpRequestTest", 1,
                    "Failed to send XHR request");
        }
      }
    </script>
  </head>

  <body onLoad="setTimeout(ValidateUserAgent, 100);">
    ChromeFrame full tab mode XMLHttpRequest test. Verifies that
    XMLHttpRequests use the host network stack.
  </body>
</html>

Fix for the ChromeFrame XHR test failures. This test was incorrectly hardcoding the xhr url as localhost:1337 which does not work after the recent http test server reorg.
Fix for the ChromeFrame XHR test failures. This test was incorrectly hardcoding the
xhr url as localhost:1337 which does not work after the recent http test server reorg.

We now use the GetBaseUrlPath helper function to form the url used for XHR requests.

Review URL: http://codereview.chromium.org/3106025

git-svn-id: http://src.chromium.org/svn/trunk/src@56711 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: decea7da62c761382edbac1d564550fd12c53151