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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/test-helpers.js

Issue 291263002: ServiceWorker: Strip fragment from scope and script URLs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make normalizeURL remove fragment Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/serviceworkerobject-scope.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Adapter for testharness.js-style tests with Service Workers 1 // Adapter for testharness.js-style tests with Service Workers
2 2
3 function service_worker_test(url, description) { 3 function service_worker_test(url, description) {
4 var t = async_test(description); 4 var t = async_test(description);
5 t.step(function() { 5 t.step(function() {
6 6
7 navigator.serviceWorker.register(url, {scope:'nonexistent'}).then( 7 navigator.serviceWorker.register(url, {scope:'nonexistent'}).then(
8 t.step_func(function(worker) { 8 t.step_func(function(worker) {
9 var messageChannel = new MessageChannel(); 9 var messageChannel = new MessageChannel();
10 messageChannel.port1.onmessage = t.step_func(onMessage); 10 messageChannel.port1.onmessage = t.step_func(onMessage);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 function with_iframe(url, f) { 51 function with_iframe(url, f) {
52 var frame = document.createElement('iframe'); 52 var frame = document.createElement('iframe');
53 frame.src = url; 53 frame.src = url;
54 frame.onload = function() { 54 frame.onload = function() {
55 f(frame); 55 f(frame);
56 }; 56 };
57 document.body.appendChild(frame); 57 document.body.appendChild(frame);
58 } 58 }
59 59
60 function normalizeURL(url) { 60 function normalizeURL(url) {
61 return new URL(url, document.location).toString(); 61 return new URL(url, document.location).toString().replace(/#.*$/, '');
62 } 62 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/serviceworkerobject-scope.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698