Skip to content

Commit

Permalink
Merge pull request #1324 from w3c/jgraham/flaky_resource_timing
Browse files Browse the repository at this point in the history
Try to avoid a race when checking performance of stylesheet loads.
  • Loading branch information
jgraham committed Oct 29, 2014
2 parents 854f8ac + 6d1e0e3 commit 89057be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resource-timing/test_resource_timing.js
Expand Up @@ -115,9 +115,10 @@ function poll_for_stylesheet_load(expected_entry) {
function inner() {
for(var i=0; i<document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
console.log(sheet.href);;
if (sheet.href === expected_entry.name) {
resource_load(expected_entry);
setTimeout(function() {
resource_load(expected_entry);
}, 200);
return;
}
}
Expand Down

0 comments on commit 89057be

Please sign in to comment.