| Index: third_party/WebKit/LayoutTests/http/tests/webfont/resources/font-load-revalidation-frame.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/webfont/resources/font-load-revalidation-frame.html b/third_party/WebKit/LayoutTests/http/tests/webfont/resources/font-load-revalidation-frame.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fee231d0212d88b99449ca93896bcbd6406f2930
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/webfont/resources/font-load-revalidation-frame.html
|
| @@ -0,0 +1,25 @@
|
| +<!doctype html>
|
| +<html>
|
| +<body>
|
| +<div>font loading revalidation test</div>
|
| +<script>
|
| +// Try to cover the case FontResource is reused even after
|
| +// frame.location.reload(). So that memory cache performs revalidation,
|
| +// The URL should not have a query like .cgi?delay=100, and HTTP response
|
| +// should have at least either Last-modified or Etag header.
|
| +var font = new FontFace('Foo', 'url(../cachable-slow-ahem-loading.cgi)', {});
|
| +var startTime = performance.now();
|
| +font.load();
|
| +font.loaded.then(() => {
|
| + var loadTime = performance.now() - startTime;
|
| + parent.postMessage('pass:font.load()', '*');
|
| + var testName = 'loadTime > 900';
|
| + var testResult = loadTime > 900 ? 'pass' : 'fail';
|
| + parent.postMessage([testResult, testName].join(':'), '*');
|
| + parent.postMessage('reload', '*');
|
| +}, () => {
|
| + parent.postMessage('fail:font.load()', '*');
|
| +});
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|