Skip to content
Permalink
Browse files
2011-03-05 Andrey Kosyakov <caseq@chromium.org>
        Unreviewed. Another shot at fixing flakiness of extension-events.html.

        * inspector/extensions/extensions-events.html:


Canonical link: https://commits.webkit.org/70320@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
caseq committed Mar 5, 2011
1 parent 4e1a508 commit 450a28e33ee51376a896563bd4445ea147c69d6b
Showing with 23 additions and 14 deletions.
  1. +6 −0 LayoutTests/ChangeLog
  2. +17 −14 LayoutTests/inspector/extensions/extensions-events.html
@@ -1,3 +1,9 @@
2011-03-05 Andrey Kosyakov <caseq@chromium.org>

Unreviewed. Another shot at fixing flakiness of extension-events.html.

* inspector/extensions/extensions-events.html:

2011-03-05 Pavel Feldman <pfeldman@chromium.org>

Not reviewed: chromium rebaseline, flaky test fix.
@@ -33,27 +33,30 @@

function extension_testPageLoadEvents(nextTest)
{
var callbackCount = 0;
var onLoadArgument;

webInspector.inspectedWindow.onDOMContentLoaded.addListener(function(time) {
output("onDOMContentLoaded fired: " + typeof time);
});
var queuedOutput = [];

// Logging on onLoaded is tricky due to race conditions with output("Page reloaded") in page initialization code.
// So only log when we're sure both onLoaded fired and reload is done.
function reloadCallback()
// So only log when we're sure all handlers are called and reload is done.
function queueOutputAndContinue(message)
{
if (++callbackCount < 2)
queuedOutput.push(message);
if (queuedOutput.length != 3)
return;
output("onLoaded fired: " + typeof onLoadArgument);
nextTest();
for (i = 0; i < queuedOutput.length; ++i) {
if (queuedOutput[i])
output(queuedOutput[i]);
}
nextTest();
}

webInspector.inspectedWindow.onDOMContentLoaded.addListener(function(time) {
queueOutputAndContinue("onDOMContentLoaded fired: " + typeof time);
});

webInspector.inspectedWindow.onLoaded.addListener(function(time) {
onLoadArgument = time;
reloadCallback();
queueOutputAndContinue("onLoaded fired: " + typeof time);
});
dispatchOnFrontend({ command: "reload" }, reloadCallback);
dispatchOnFrontend({ command: "reload" }, queueOutputAndContinue);
}

</script>

0 comments on commit 450a28e

Please sign in to comment.