WebKit Bugzilla
Attachment 356192 Details for
Bug 192232
: Test that CSS subresource loading are exposed to resource timing in case of a CORS loaded CSS stylesheet but not imported stylesheets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192232-20181130102301.patch (text/plain), 4.11 KB, created by
youenn fablet
on 2018-11-30 10:23:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-11-30 10:23:01 PST
Size:
4.11 KB
patch
obsolete
>Subversion Revision: 238644 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 730bcabaeb8c384542517d50d3ddd18f111ed88b..4080c82009b381e918af94b45838e5dfddf152d2 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-11-30 Youenn Fablet <youenn@apple.com> >+ >+ Test that CSS subresource loading are exposed to resource timing in case of a CORS loaded CSS stylesheet but not imported stylesheets >+ https://bugs.webkit.org/show_bug.cgi?id=192232 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/security/cross-origin-clean-css-resource-timing-expected.txt: Added. >+ * http/tests/security/cross-origin-clean-css-resource-timing.html: Added. >+ * http/tests/security/resources/loading-subresources.php: Added. >+ > 2018-11-29 Youenn Fablet <youenn@apple.com> > > CSS subresource loads should not be observable from resource timing if the stylesheet is opaque >diff --git a/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing-expected.txt b/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d901ed148e7e9155f15ad8a417f6776ac9342658 >--- /dev/null >+++ b/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS CSS subresources of a clean stylesheet should populate resource timing entries, but not for imported stylesheets >+ >diff --git a/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing.html b/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a2ba08b2438b0ee519f62a9e421d77824dde6d8e >--- /dev/null >+++ b/LayoutTests/http/tests/security/cross-origin-clean-css-resource-timing.html >@@ -0,0 +1,51 @@ >+<!doctype html> >+<html> >+<head> >+<title>CSS subresources of a clean stylesheet should populate resource timing entries, but not for imported stylesheets</title> >+<script src=/resources/testharness.js></script> >+<script src=/resources/testharnessreport.js></script> >+<link href='http://localhost:8080/security/resources/loading-subresources.php' rel='stylesheet' type='text/css' crossorigin="anonymous"> >+</head> >+<body> >+<div id="mydiv" style="font: 12px 'ahem'">Test</div> >+<script> >+const waitOnLoad = new Promise((resolve) => { >+ window.onload = resolve; >+}) >+ >+function waitFor(delay) >+{ >+ return new Promise(resolve => setTimeout(resolve, delay)); >+} >+ >+document.fonts.ready.then(async () => { >+ await waitOnLoad; >+ let hasImport = false; >+ let hasImage = false; >+ let hasCursor = false; >+ let hasFont = false; >+ let counter = 0; >+ while (++counter < 20) { >+ const entries = performance.getEntries(); >+ if (!hasImport) >+ hasImport = entries.some(entry => entry.name.includes('imported-loading-subresources.css')); >+ if (!hasImage) >+ hasImage = entries.some(entry => entry.name.includes('abe-allow-star.php?image')); >+ if (!hasCursor) >+ hasCursor = entries.some(entry => entry.name.includes('abe-allow-star.php?cursor')); >+ if (!hasFont) >+ hasFont = entries.some(entry => entry.name.includes('Ahem.woff')); >+ if (hasImport && hasFont && hasCursor) >+ break; >+ await waitFor(50); >+ } >+ mydiv.innerHTML = ""; >+ assert_true(hasImport, "import"); >+ assert_false(hasImage, "image"); >+ assert_true(hasCursor, "cursor"); >+ assert_true(hasFont, "font"); >+ done(); >+}) >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/security/resources/loading-subresources.php b/LayoutTests/http/tests/security/resources/loading-subresources.php >new file mode 100644 >index 0000000000000000000000000000000000000000..6c8f34fcd856a2cdfc5d582abc4793fcd3127796 >--- /dev/null >+++ b/LayoutTests/http/tests/security/resources/loading-subresources.php >@@ -0,0 +1,11 @@ >+<?php >+header("Access-Control-Allow-Origin: *"); >+ >+$name = 'loading-subresources.css'; >+$fp = fopen($name, 'rb'); >+header("Content-Type: text/css"); >+header("Content-Length: " . filesize($name)); >+ >+fpassthru($fp); >+exit; >+?>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192232
: 356192 |
356208