author Jon Coppeard <>
Wed, 22 Aug 2018 14:54:17 +0100
changeset 432835 3f1d6721cab0d1668a2441f7b0b7d018f1ac6475
parent 210530 e3e717e9b62827b16b236fa67bcdce7f6065a89e
child 439146 58adc643dcdc20eccb4d30bc454b50420e96c020
permissions -rw-r--r--
Bug 1469599 - Associate all module scripts in a module graph with DOM elements before execution r=hsivonen

  <title>Test for Bug 580069</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<a target="_blank" href="">Mozilla Bug 580069</a>

<iframe id='iframe' src='file_bug580069_1.html'></iframe>

<script type="application/javascript">


var iframe = document.getElementById('iframe');
var iframeCw = iframe.contentWindow;

// Called when file_bug580069_1.html loads.
function page1Load() {
  // This should cause us to load file 2.

// Called when file_bug580069_2.html loads.
var page2Loads = 0;
function page2Load(method) {

  dump("iframe's location is: " + iframeCw.location + ", method is " + method + "\n");

  if (page2Loads == 0) {
    is(method, "POST", "Method for first load should be POST.");
    iframeCw.history.replaceState('', '', '?replaced');

    // This refresh shouldn't pop up the "are you sure you want to refresh a page
    // with POST data?" dialog.  If it does, this test will hang and fail, and
    // we'll see 'Refreshing iframe...' at the end of the test log.
    dump('Refreshing iframe...\n');
  else if (page2Loads == 1) {
    is(method, "GET", "Method for second load should be GET.");
    is(, "?replaced", "Wrong search on iframe after refresh.");
  else {
    ok(false, "page2Load should only be called twice.");