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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 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: third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html
new file mode 100644
index 0000000000000000000000000000000000000000..3ad593375ac67c9ff92b9b6ea073f45e0f7ce280
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html
@@ -0,0 +1,109 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>HTTP Cache - Partial Content</title>
+ <meta name="help" href="https://fetch.spec.whatwg.org/#request">
+ <meta name="timeout" content="long">
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/utils.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+ <script src="http-cache.js"></script>
+ </head>
+ <body>
+ <script>
+ var tests = [
+ {
+ name: 'HTTP cache stores partial content and reuses it.',
+ requests: [
+ {
+ request_headers: [
+ ['Range', "bytes=-5"]
+ ],
+ response_status: [206, "Partial Content"],
+ response_headers: [
+ ['Cache-Control', 'max-age=3600'],
+ ['Content-Range', 'bytes 0-4/10']
+ ],
+ response_body: "01234",
+ expected_request_headers: [
+ ['Range', "bytes=-5"]
+ ],
+ },
+ {
+ request_headers: [
+ ['Range', "bytes=-5"]
+ ],
+ expected_type: "cached",
+ expected_status: 206
+ }
+ ]
+ },
+ {
+ name: 'HTTP cache stores complete response and serves smaller ranges from it.',
+ requests: [
+ {
+ response_headers: [
+ ['Cache-Control', 'max-age=3600'],
+ ],
+ response_body: "01234567890",
+ },
+ {
+ request_headers: [
+ ['Range', "bytes=-1"]
+ ],
+ expected_type: "cached",
+ expected_response_text: "01"
+ }
+ ]
+ },
+ {
+ name: 'HTTP cache stores partial response and serves smaller ranges from it.',
+ requests: [
+ {
+ request_headers: [
+ ['Range', "bytes=-5"]
+ ],
+ response_status: [206, "Partial Content"],
+ response_headers: [
+ ['Cache-Control', 'max-age=3600'],
+ ['Content-Range', 'bytes 0-4/10']
+ ],
+ response_body: "01234",
+ },
+ {
+ request_headers: [
+ ['Range', "bytes=-1"]
+ ],
+ expected_type: "cached",
+ expected_response_text: "01"
+ }
+ ]
+ },
+ {
+ name: 'HTTP cache stores partial content and completes it.',
+ requests: [
+ {
+ request_headers: [
+ ['Range', "bytes=-5"]
+ ],
+ response_status: [206, "Partial Content"],
+ response_headers: [
+ ['Cache-Control', 'max-age=3600'],
+ ['Content-Range', 'bytes 0-4/10']
+ ],
+ response_body: "01234",
+ },
+ {
+ expected_request_headers: [
+ ["range", "bytes=5-"]
+ ]
+ }
+ ]
+ },
+ ];
+ run_tests(tests);
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698