| Index: third_party/WebKit/LayoutTests/http/tests/preload/document-write/document_write_preload_stubs.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/preload/document-write/document_write_preload_stubs.html b/third_party/WebKit/LayoutTests/http/tests/preload/document-write/document_write_preload_stubs.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ab0070074d204a159215e50f021abf70de7cc74f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/preload/document-write/document_write_preload_stubs.html
|
| @@ -0,0 +1,26 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +var t = async_test('Accessors like location should be properly stubbed to aid in preloading scripts injected via document.write');
|
| +// We reject scripts with "for", so rename window.performance.
|
| +window.perf = window.performance;
|
| +</script>
|
| +<script>
|
| +if (window.perf)
|
| + var boundedStart = window.perf.now();
|
| +var src = window.location.protocol + '//' + window.location.hostname + ':8000' + '/resources/dummy.js';
|
| +document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
|
| +</script>
|
| +<script>
|
| +window.addEventListener("load", t.step_func(function() {
|
| + window.performance.getEntriesByType('resource').forEach(function(r) {
|
| + if (r.name.indexOf('dummy.js') != -1) {
|
| + assert_less_than(r.startTime, boundedStart);
|
| + assert_greater_than(r.startTime, 0);
|
| + t.done();
|
| + }
|
| + });
|
| +}));
|
| +</script>
|
| +
|
|
|