Bug 801576 - Fix {push,pop}State tests. r=jlebar
authorBobby Holley <bobbyholley@gmail.com>
Wed, 24 Oct 2012 12:04:18 +0200
changeset 111234 95806d8419f95a8234a4c7875e671a67b0b613cd
parent 111233 ace0976ace07a0acca74a3531bc9a3f80b604127
child 111235 6973d363e3e111d43db46e69eac4803bb1c17cbe
push id23735
push userryanvm@gmail.com
push dateWed, 24 Oct 2012 18:05:23 +0000
treeherdermozilla-central@6de521e0ae9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs801576
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 801576 - Fix {push,pop}State tests. r=jlebar
dom/tests/mochitest/whatwg/test_bug500328.html
--- a/dom/tests/mochitest/whatwg/test_bug500328.html
+++ b/dom/tests/mochitest/whatwg/test_bug500328.html
@@ -395,24 +395,17 @@ function runTest() {
 
   ok(!ifLink.href.match("mytestdir"),
      "inner frame's link shouldn't contain 'mytestdir'.");
 
   /*
    * TEST 2 tests that pushstate's same-origin checks are correct.
    */
   var filename = 'file_bug500328_2.html';
-  // Get the directory we're currently in
-  var dirname = document.location.pathname.replace(/[^\/]*$/, '');
-  statusMsg("Dirname is: " + dirname);
-  var loc = 'http://example.com' + dirname + filename;
-  statusMsg("About to transfer iframe to " + loc);
-  iframeCw.location = loc;
-  // We have to register a listener like this because this file is hosted on a
-  // different domain and can't notify us on load.
+  iframeCw.location = filename;
   iframe.onload = onChildLoad;
   enableChildLoadCallback();
   yield;
 
   // This function tries to pushstate and replacestate to the given URL and
   // fails the test if the calls succeed.
   var tryBadPushAndReplaceState = function(url) {
     // XXX ex should be a SECURITY_ERR, not a plain Error.
@@ -429,23 +422,23 @@ function runTest() {
     expectException(function() { hist.replaceState({}, "foo", url); },
                     'replaceState to ' + url);
 
     expectException(function() { hist.replaceState({}, "foo", url2); },
                     'replaceState to ' + url2);
   }
 
   // We're currently at http://example.com/[dirname]/[filename]
-  tryBadPushAndReplaceState("https://example.com");
-  tryBadPushAndReplaceState("http://foo.example.com");
-  tryBadPushAndReplaceState("http://example.com:1234");
-  tryBadPushAndReplaceState("http://example.com.a");
-  tryBadPushAndReplaceState("http://example.con");
-  tryBadPushAndReplaceState("http://eexample.com");
-  tryBadPushAndReplaceState("http://me@example.com");
+  tryBadPushAndReplaceState("https://mochi.test:8888");
+  tryBadPushAndReplaceState("http://foo.mochitest:8888");
+  tryBadPushAndReplaceState("http://mochi.test:1234");
+  tryBadPushAndReplaceState("http://mochi.test.a:8888");
+  tryBadPushAndReplaceState("http://mochi.tes:8888");
+  tryBadPushAndReplaceState("http://mmochi.test:8888");
+  tryBadPushAndReplaceState("http://me@mochi.test:8888");
 
   /**
    * TEST 3 tests that the session history entries' titles are properly sync'ed
    * after push/pop states.
    *
    * We have to run this test in a popup rather than an iframe because only the
    * root docshell has a session history object.
    */