Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/preload/download_only_supported_stylesheet_types.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/download_only_supported_stylesheet_types.html b/third_party/WebKit/LayoutTests/http/tests/preload/download_only_supported_stylesheet_types.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..07c211800489683914a102c219e3820c5c976b5f |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/preload/download_only_supported_stylesheet_types.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
|
Yoav Weiss
2016/01/25 09:55:54
Maybe change the path for this test to be under ht
suzyh_UTC10 (ex-contributor)
2016/01/27 00:07:53
Done.
|
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script> |
| + var t = async_test('Makes sure that unsupported stylesheet types are neither preloaded nor loaded'); |
| + var cssLoaded = false; |
| + var jsLoaded = false; |
| + var noTypeLoaded = false; |
| +</script> |
| +<link rel=stylesheet href="../resources/dummy.css?1" type="text/css" onload="cssLoaded = true;"> |
| +<link rel=stylesheet href="../resources/dummy.css?2" type="application/javascript" onload="jsLoaded = true;"> |
| +<link rel=stylesheet href="../resources/dummy.css?3" onload="noTypeLoaded = true;"> |
| +<script src="../resources/slow-script.pl?delay=500"></script> |
|
Yoav Weiss
2016/01/25 09:55:54
Can you bump the delay up before the <link>s (in o
suzyh_UTC10 (ex-contributor)
2016/01/27 00:07:53
Done.
|
| +<script> |
| + window.addEventListener("load", t.step_func(function() { |
| + var entries = performance.getEntriesByType("resource"); |
| + for (var i = 0; i < entries.length; ++i) { |
| + console.log(entries[i].name); |
| + } |
| + assert_equals(entries.length, 5); |
| + assert_true(cssLoaded, "text/css triggered load event"); |
| + assert_false(jsLoaded, "application/javascript triggered load event"); |
| + assert_true(noTypeLoaded, "no type triggered load event"); |
| + t.done(); |
| + })); |
| +</script> |
| + |