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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/fetch-request-css-cross-origin-mime-check-worker.js

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: add files 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 unified diff | Download patch
OLDNEW
(Empty)
1 importScripts('../../resources/get-host-info.js');
2 importScripts('test-helpers.js');
3
4 self.addEventListener('fetch', function(event) {
5 if (event.request.url.indexOf('cross-origin-css.css') != -1) {
6 event.respondWith(fetch(
7 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() +
8 'fetch-request-css-cross-origin-mime-check-cross.css',
9 {mode: 'no-cors'}));
10 } else if (event.request.url.indexOf('cross-origin-html.css') != -1) {
11 event.respondWith(fetch(
12 get_host_info()['HTTP_REMOTE_ORIGIN'] + base_path() +
13 'fetch-request-css-cross-origin-mime-check-cross.html',
14 {mode: 'no-cors'}));
15 } else if (event.request.url.indexOf('synthetic.css') != -1) {
16 event.respondWith(new Response("#synthetic { color: blue; }"));
17 } else {
18 event.respondWith(fetch(event.request));
19 }
20 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698