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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-request-css-base-url.html

Issue 732003002: Use the request URL as the URL of the resources which are fetched ServiceWorker [3/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add comment Created 6 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-iframe.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: CSS's base URL must be the request URL even when fetched from other URL</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js?pipe=sub"></script>
6 <script>
7 async_test(function(t) {
8 var SCOPE = 'resources/fetch-request-css-base-url-iframe.html';
9 var SCRIPT = 'resources/fetch-request-css-base-url-worker.js';
10 var worker;
11 var frame;
12
13 return service_worker_unregister_and_register(t, SCRIPT, SCOPE)
14 .then(function(registration) {
15 return wait_for_update(t, registration);
16 })
17 .then(function(sw) {
18 worker = sw;
19 return wait_for_state(t, sw, 'activated');
20 })
21 .then(function() {
22 return new Promise(function(resolve) {
23 var channel = new MessageChannel();
24 channel.port1.onmessage = t.step_func(function(msg) {
25 if (msg.data.ready) {
26 resolve();
27 return;
28 }
29 var result = msg.data;
30 var base = get_host_info()['HTTP_ORIGIN'] + base_path();
31 assert_equals(
32 result.url,
33 base + 'resources/dummy.png',
34 'The base URL while loading the images referred from CSS ' +
35 'must be the request URL of CSS.');
36 assert_equals(
37 result.referrer,
38 base + 'resources/fetch-request-css-base-url-style.css',
39 'While loading the image defined in CSS the referrer must ' +
40 'be the request URL of CSS.');
41 unload_iframe(frame);
42 service_worker_unregister_and_done(t, SCOPE);
43 });
44 worker.postMessage(
45 {port: channel.port2}, [channel.port2]);
46 });
47 })
48 .then(function() { return with_iframe(SCOPE); })
49 .then(function(f) {
50 frame = f;
51 })
52 .catch(unreached_rejection(t));
53 }, 'CSS\'s base URL must be the request URL even when fetched from other URL.' );
54 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/fetch-request-css-base-url-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698