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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/webfont/font-display.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 | « no previous file | third_party/WebKit/LayoutTests/http/tests/webfont/font-display-intervention.html » ('j') | 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</title> 2 <title>Test for font-display @font-face descriptor</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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 for (var display, j = 0; display = fontDisplayValues[j]; j++) { 53 for (var display, j = 0; display = fontDisplayValues[j]; j++) {
54 var family = [display, config.time, config.delay].join('-'); 54 var family = [display, config.time, config.delay].join('-');
55 var rule = makeFontFaceDeclaration(family, config, display); 55 var rule = makeFontFaceDeclaration(family, config, display);
56 document.styleSheets[0].insertRule(rule, 0); 56 document.styleSheets[0].insertRule(rule, 0);
57 var td = document.createElement('td'); 57 var td = document.createElement('td');
58 td.textContent = 'a'; 58 td.textContent = 'a';
59 td.style.fontFamily = family + ', Arial'; 59 td.style.fontFamily = family + ', Arial';
60 tr.appendChild(td); 60 tr.appendChild(td);
61 } 61 }
62 table.appendChild(tr); 62 table.appendChild(tr);
63 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr), maxTime - config.time); 63 if (config.time == 0) {
64 setTimeout((function(tr){
65 tr.classList.remove('hidden');
66 if (window.testRunner)
67 testRunner.notifyDone();
68 }).bind(null, tr), maxTime);
69 } else {
70 setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr), maxTime - config.time);
71 }
64 } 72 }
65
66 if (window.testRunner)
67 setTimeout(function() { testRunner.notifyDone(); }, maxTime);
68 } 73 }
69 74
70 </script> 75 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/webfont/font-display-intervention.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698