Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/webfont/font-display-intervention.html

Issue 2584473002: Merge setTimeout calls with same timeout for webfont tests. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/webfont/font-display.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test for font-display @font-face descriptor with User-Agent Intervention< /title> 2 <title>Test for font-display @font-face descriptor with User-Agent Intervention< /title>
3 <style> 3 <style>
4 .hidden { display: none; } 4 .hidden { display: none; }
5 </style> 5 </style>
6 <p>Tests how text with a font that takes <i>delay</i> seconds to load look like after <i>T</i> seconds from load start.</p> 6 <p>Tests how text with a font that takes <i>delay</i> seconds to load look like after <i>T</i> seconds from load start.</p>
7 <table id="container"> 7 <table id="container">
8 <tr> 8 <tr>
9 <th>T[sec]</th> 9 <th>T[sec]</th>
10 <th>delay[sec]</th> 10 <th>delay[sec]</th>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 for (var display, j = 0; display = fontDisplayValues[j]; j++) { 64 for (var display, j = 0; display = fontDisplayValues[j]; j++) {
65 var family = [display, config.time, config.delay].join('-'); 65 var family = [display, config.time, config.delay].join('-');
66 var rule = makeFontFaceDeclaration(family, config, display); 66 var rule = makeFontFaceDeclaration(family, config, display);
67 document.styleSheets[0].insertRule(rule, 0); 67 document.styleSheets[0].insertRule(rule, 0);
68 var td = document.createElement('td'); 68 var td = document.createElement('td');
69 td.textContent = 'a'; 69 td.textContent = 'a';
70 td.style.fontFamily = family + ', Arial'; 70 td.style.fontFamily = family + ', Arial';
71 tr.appendChild(td); 71 tr.appendChild(td);
72 } 72 }
73 table.appendChild(tr); 73 table.appendChild(tr);
74 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr), maxTime - config.time); 74 if (config.time == 0) {
75 setTimeout((function(tr){
76 tr.classList.remove('hidden');
77 if (window.testRunner)
78 testRunner.notifyDone();
79 }).bind(null, tr), maxTime);
80 } else {
81 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr), maxTime - config.time);
82 }
75 } 83 }
76
77 if (window.testRunner)
78 setTimeout(function() { testRunner.notifyDone(); }, maxTime);
79 } 84 }
80 85
81 </script> 86 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/webfont/font-display.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698