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

Unified Diff: LayoutTests/http/tests/serviceworker/chromium/resources/service-worker-generated-mixed-response-worker.js

Issue 1226473002: Add LayoutTests for mixed range response handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: LayoutTests/http/tests/serviceworker/chromium/resources/service-worker-generated-mixed-response-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/chromium/resources/service-worker-generated-mixed-response-worker.js b/LayoutTests/http/tests/serviceworker/chromium/resources/service-worker-generated-mixed-response-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..866fced5df62910a15ca59e9a3e35860a1e70dcd
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/chromium/resources/service-worker-generated-mixed-response-worker.js
@@ -0,0 +1,20 @@
+self.addEventListener('fetch', function(event) {
+ if (event.request.url.indexOf('blank.html') != -1) {
+ // The request is for the page load.
+ return;
+ }
+ if (event.request.headers.get('range') != 'bytes=0-') {
+ // The request is not the first range request.
+ return;
+ }
+ event.respondWith(
+ new Response(
+ 'Ogg',
+ {
+ status: 206,
+ headers: {
+ 'content-type': 'audio/ogg',
+ 'content-range': 'bytes 0-3/12983'
+ }
+ }));
+});
falken 2015/07/03 04:10:36 indent two spaces
horo 2015/07/06 11:45:40 Done.

Powered by Google App Engine
This is Rietveld 408576698