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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/webfont/webfont-performance-duration.html

Issue 1893233002: WebFonts: reset m_loadLimitState on memory cache revalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: #14 Created 4 years, 8 months 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test.js"></script> 2 <script src="/js-test-resources/js-test.js"></script>
3 3
4 <div id="target">Hello webfont</div> 4 <div id="target">Hello webfont</div>
5 5
6 <script> 6 <script>
7 if (window.testRunner) 7 jsTestIsAsync = true;
8 testRunner.waitUntilDone();
9 8
10 var waitMillisBeforeFetching = 300; 9 var waitMillisBeforeFetching = 300;
11 var entry; 10 var entry;
12 var fontFace = new FontFace('ahem', "url('../../../../misc/resources/acid3/font. ttf')"); 11 var fontFace = new FontFace('ahem', "url('../../../../misc/resources/acid3/font. ttf')");
13 document.fonts.add(fontFace); 12 document.fonts.add(fontFace);
14 13
15 new Promise(function(resolve) { 14 new Promise(function(resolve) {
16 setTimeout(resolve, waitMillisBeforeFetching); 15 setTimeout(resolve, waitMillisBeforeFetching);
17 }).then(function() { 16 }).then(function() {
18 var target = document.getElementById('target'); 17 var target = document.getElementById('target');
19 target.style['font-family'] = 'ahem'; 18 target.style['font-family'] = 'ahem';
20 return fontFace.loaded; 19 return fontFace.loaded;
21 }).then(function() { 20 }).then(function() {
22 var name = document.location.origin + '/misc/resources/acid3/font.ttf'; 21 var name = document.location.origin + '/misc/resources/acid3/font.ttf';
23 entry = window.performance.getEntriesByName(name)[0]; 22 entry = window.performance.getEntriesByName(name)[0];
24 shouldBeTrue('entry.startTime >= waitMillisBeforeFetching'); 23 shouldBeTrue('entry.startTime >= waitMillisBeforeFetching');
25 if (window.testRunner) 24 finishJSTest();
26 testRunner.notifyDone();
27 }); 25 });
28 </script> 26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698