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

Unified Diff: LayoutTests/http/tests/media/resources/serve-video.php

Issue 615193004: Add layout tests for seeks to zero on streaming sources. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Spaces! Created 6 years, 2 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
« no previous file with comments | « LayoutTests/http/tests/media/resources/load-video.php ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/media/resources/serve-video.php
diff --git a/LayoutTests/http/tests/media/resources/serve-video.php b/LayoutTests/http/tests/media/resources/serve-video.php
index 55b3303f48679a7f18c082e8c035befe8116dd4c..9bfcf0289d2bd43e237cbf4b7c31524221842a57 100644
--- a/LayoutTests/http/tests/media/resources/serve-video.php
+++ b/LayoutTests/http/tests/media/resources/serve-video.php
@@ -7,9 +7,9 @@
$start = 0;
$end = $fileSize - 1;
$contentRange = $_SERVER["HTTP_RANGE"];
- if (isset($contentRange)) {
- $range = explode("-", substr($contentRange, strlen("bytes=")));
- $start = intval($range[0]);
+ if (isset($contentRange) && empty($_GET["norange"])) {
+ $range = explode("-", substr($contentRange, strlen("bytes=")));
+ $start = intval($range[0]);
if (!empty($range[1]))
$end = intval($range[1]);
$httpStatus = "206 Partial Content";
@@ -22,10 +22,11 @@
header("Pragma: no-cache");
header("Etag: " . '"' . $fileSize . "-" . filemtime($fileName) . '"');
header("Content-Type: " . $type);
- header("Accept-Ranges: bytes");
header("Content-Length: " . ($end - $start) + 1);
- if ($contentRange)
- header("Content-Range: bytes " . $start . "-" . $end . "/" . $fileSize);
+ if ($contentRange && empty($_GET["norange"])) {
+ header("Accept-Ranges: bytes");
+ header("Content-Range: bytes " . $start . "-" . $end . "/" . $fileSize);
+ }
header("Connection: close");
$chunkSize = 1024 * 256;
« no previous file with comments | « LayoutTests/http/tests/media/resources/load-video.php ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698