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> |