Open Bug 668209 Opened 8 years ago Updated 8 years ago

Make browser_459906_sample.html non-flaky

Categories

(Firefox :: Session Restore, defect)

defect
Not set

Tracking

()

People

(Reporter: hsivonen, Unassigned)

References

(Blocks 1 open bug, )

Details

browser_459906_sample.html has this bit:
      // inject a cross domain file ...
      var documentInjected = false;
      document.getElementsByTagName("iframe")[0].onload =
        function() { documentInjected = true; };
      frames[0].location = "browser_459906_empty.html";
      
      // ... and ensure that it has time to load
      for (var c = 0; !documentInjected && c < 20; c++) {
        var r = new XMLHttpRequest();
        r.open("GET", location.href, false);
        r.overrideMimeType("text/plain");
        r.send(null);
      }

That spinning up a nested event loop up to 20 times to make the load event fire from a nested event loop is not cool.

I'd expect a test like this to be structured to wait for the load event without any event loop tricks and to continue from there.
You need to log in before you can comment on or make changes to this bug.