Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-css-cross-origin-mime-check.html

Issue 1861243002: Check the mime type of cross-origin CSS fetched via the Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-css-cross-origin-mime-check.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-css-cross-origin-mime-check.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-css-cross-origin-mime-check.html
new file mode 100644
index 0000000000000000000000000000000000000000..0f609a1885930f8b15435f012e433b7913abce1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-css-cross-origin-mime-check.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<title>Service Worker: Mime type of cross-origin CSS fetched via SW must be checked.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/get-host-info.js?pipe=sub"></script>
+<script src="resources/test-helpers.js"></script>
+<script>
+promise_test(function(t) {
+ var SCOPE =
+ 'resources/fetch-request-css-cross-origin-mime-check-iframe.html';
+ var SCRIPT =
+ 'resources/fetch-request-css-cross-origin-mime-check-worker.js';
+
+ return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
+ .then(function(registration) {
+ return wait_for_state(t, registration.installing, 'activated');
+ })
Mike West 2016/04/06 06:54:16 Nit: These are prettier as arrow functions (e.g. `
horo 2016/04/06 08:13:50 Done.
+ .then(function() { return with_iframe(SCOPE); })
+ .then(function(f) {
+ var style =
+ f.contentWindow.getComputedStyle(f.contentDocument.body, '');
+ assert_equals(style['background-color'], 'rgb(255, 255, 255)',
+ 'The background color must not be overridden.');
+ f.remove();
+ return service_worker_unregister_and_done(t, SCOPE);
+ });
+ }, 'Mime type of cross-origin CSS fetched via SW must be checked.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698