Skip to content

Commit

Permalink
Replace setTimeout (web-platform-tests#3797)
Browse files Browse the repository at this point in the history
  • Loading branch information
plehegar authored and sideshowbarker committed Sep 26, 2016
1 parent d6f8c0c commit 76bf1d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resource-timing/test_resource_timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ onload = function()
};

function poll_for_stylesheet_load(expected_entry) {
var t = tests[expected_entry.initiatorType];

function inner() {
for(var i=0; i<document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
Expand All @@ -120,14 +122,14 @@ function poll_for_stylesheet_load(expected_entry) {
hasRules = false;
}
if (hasRules) {
setTimeout(function() {
t["entry"].step_timeout(function() {
resource_load(expected_entry);
}, 200);
return;
}
}
}
setTimeout(inner, 100);
t["entry"].step_timeout(inner, 100);
}
inner();
}
Expand Down

0 comments on commit 76bf1d7

Please sign in to comment.