Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <div>font loading revalidation test</div> | |
| 5 <script> | |
| 6 // Try to cover the case FontResource is reused even after | |
| 7 // frame.location.reload(). So that memory cache performs revalidation, | |
| 8 // The URL should not have a query like .cgi?delay=100, and HTTP response | |
| 9 // should have at least either Last-modified or Etag header. | |
| 10 var font = new FontFace('Foo', 'url(../cachable-slow-ahem-loading.cgi)', {}); | |
| 11 var startTime = performance.now(); | |
| 12 font.load(); | |
| 13 font.loaded.then(() => { | |
| 14 var loadTime = performance.now() - startTime; | |
| 15 parent.postMessage('pass:font.load()', '*'); | |
|
hiroshige
2016/04/21 07:39:10
We don't have lines |PASS font.load()| in -expecte
Takashi Toyoshima
2016/04/21 08:31:25
Oops, good point. I forget to update the expectati
| |
| 16 var testName = 'loadTime > 900'; | |
| 17 var testResult = loadTime > 900 ? 'pass' : 'fail'; | |
| 18 parent.postMessage([testResult, testName].join(':'), '*'); | |
| 19 parent.postMessage('reload', '*'); | |
| 20 }, () => { | |
| 21 parent.postMessage('fail:font.load()', '*'); | |
| 22 }); | |
| 23 </script> | |
| 24 </body> | |
| 25 </html> | |
| OLD | NEW |