var navigationTests = {
  'Location': [
    function(contentWindow) {
      logPhase('assign location');
      contentWindow.location = '/blank.html';
    },
    'back',
    'forward',
    'back',
    function(contentWindow) {
      logPhase('replace location');
      contentWindow.location.replace('/blank.html');
    }
  ],
  'Hash': [
    function(contentWindow) {
      logPhase('assign hash');
      contentWindow.location = contentWindow.location + '#foo';
    },
    'back',
    'forward',
    'back',
    function(contentWindow) {
      logPhase('replace location');
      contentWindow.location.replace(contentWindow.location + '#bar');
    }
  ],
  'Push State': [
    function(contentWindow) {
      logPhase('pushState');
      contentWindow.history.pushState(undefined, 'foo', 'foo');
    },
    'back',
    'forward',
    'back',
    function(contentWindow) {
      logPhase('replaceState');
      contentWindow.history.replaceState(undefined, 'foo', 'foo');
    }
  ],
  'Form Submission': [
    function(contentWindow) {
      logPhase('submit form');
      var form = contentWindow.document.createElement('form');
      form.action = '/blank.html';
      form.submit();
    },
    'back',
    'forward'
  ],
  'Page Refresh': [
    function(contentWindow) {
      logPhase('reload');
      contentWindow.location.reload();
    }
  ]
};

// Defer do the page is loaded as some of these operations behave differently
// if run while the page is still loading.
setTimeout(function testStep() {
  var running = localStorage.getItem('test-running') === 'true';
  if (running) {
    var suite = navigationTests[localStorage.getItem('test-name')],
        step = parseInt(localStorage.getItem('test-step'), 10);

    localStorage.setItem('test-step', step + 1 + '');

    step = suite[step];

    if (!step) {
      (window.opener || window).completeNavTest();

      if (window.opener) {
        window.close();
      }
    } else if (step === 'back') {
      logPhase('back');
      history.back();
    } else if (step === 'forward') {
      logPhase('forward');
      history.forward();
    } else {
      step(window);
    }

    // Handle tests that don't replace the context
    //
    // This will be terminated if we are on a test that leaves the page
    // context
    setTimeout(function() {
      var interval = setInterval(function() {
        if (window.document.getElementById('continue-tests')) {
          clearInterval(interval);

          testStep();
        }
      }, 50);
    }, 500);
  }
}, 100);


@@ -24,16 +24,19 @@
 %0A  '
-Location
+Page Change
 ': %5B
@@ -90,32 +90,53 @@
 assign location'
+, document.readyState
 );%0A      content
@@ -269,32 +269,53 @@
 eplace location'
+, document.readyState
 );%0A      content
@@ -363,21 +363,379 @@
    %7D
+,
 %0A  
-%5D,%0A  'Hash
+  function(contentWindow) %7B%0A      logPhase('restore location', document.readyState);%0A      contentWindow.location = testOptions.type;%0A    %7D,%0A    function(contentWindow) %7B%0A      logPhase('submit form', document.readyState);%0A      var form = contentWindow.document.createElement('form');%0A      form.action = '/blank.html';%0A      form.submit();%0A    %7D%0A  %5D,%0A  'Single Page
 ': %5B
@@ -792,17 +792,47 @@
 ign hash
-'
+ location', document.readyState
 );%0A     
@@ -982,33 +982,210 @@
 gPhase('
-replace location'
+assign hash', document.readyState);%0A      contentWindow.hash = '#hash-foo';%0A    %7D,%0A    'back',%0A    'forward',%0A    function(contentWindow) %7B%0A      logPhase('replace location', document.readyState
 );%0A     
@@ -1259,31 +1259,38 @@
    %7D
-%0A  %5D,%0A  'Push State': %5B
+,%0A%0A    'back',%0A    'forward',%0A
 %0A   
@@ -1338,24 +1338,45 @@
 ('pushState'
+, document.readyState
 );%0A      con
@@ -1460,36 +1460,24 @@
  'forward',%0A
-    'back',%0A
     function
@@ -1523,16 +1523,37 @@
 ceState'
+, document.readyState
 );%0A     
@@ -1623,36 +1623,9 @@
    %7D
-%0A  %5D,%0A  'Form Submission': %5B
+,
 %0A   
@@ -1671,253 +1671,43 @@
 se('
-submit form');%0A      var form = contentWindow.document.createElement('form');%0A      form.action = '/blank.html';%0A      form.submit();%0A    %7D,%0A    'back',%0A    'forward'%0A  %5D,%0A  'Page Refresh': %5B%0A    function(contentWindow) %7B%0A      logPhase('reload'
+abort request', document.readyState
 );%0A 
@@ -1729,23 +1729,20 @@
 dow.
-location.reload
+abortRequest
 ();%0A

Simplify tests into two separate tests