gecko-dev/testing/web-platform/tests/fetch/http-cache
Sergio Villar Senin 20e6065a94 Bug 1532639 [wpt PR 15630] - Add <meta name=timeout content=long> to WPT in SlowTests, a=testonly
Automatic update from web-platform-tests
Add <meta name=timeout content=long> to WPT in SlowTests

This is the 2nd step in the process of banning external/wpt from
SlowTests. After cleaning up the wtp entries we're marking them as
slow by using wpt idioms, i.e.:

1) Add <meta name="timeout" content="long"> to .html files
2) Add // META: timeout=long to .js files

Bug: 765026
Change-Id: Iaf051104f419524916e19324996cc36ee37d5426
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497005
Commit-Queue: Sergio Villar <svillar@igalia.com>
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643402}

--

wpt-commits: 7287608f90f6b9530635d10086fd2ab386faab38
wpt-pr: 15630
2019-04-24 11:19:30 +01:00
..
resources
304-update.html
basic-auth-cache-test-ref.html
basic-auth-cache-test.html
cc-request.html
freshness.html
heuristic.html
http-cache.js
invalidate.html
partial.html
post-patch.html
README.md
status.html Bug 1532639 [wpt PR 15630] - Add <meta name=timeout content=long> to WPT in SlowTests, a=testonly 2019-04-24 11:19:30 +01:00
vary.html

HTTP Caching Tests

These tests cover HTTP-specified behaviours for caches, primarily from RFC7234, but as seen through the lens of Fetch.

A few notes:

  • By its nature, caching is optional; some tests expecting a response to be cached might fail because the client chose not to cache it, or chose to race the cache with a network request.

  • Likewise, some tests might fail because there is a separate document-level cache that's ill-defined; see this issue.

  • Partial content tests (a.k.a. Range requests) are not specified in Fetch; tests are included here for interest only.

  • Some browser caches will behave differently when reloading / shift-reloading, despite the cache mode staying the same.

  • At the moment, Edge doesn't appear to using HTTP caching in conjunction with Fetch at all.

Test Format

Each test run gets its own URL and randomized content and operates independently.

Each test is an an array of objects, with the following members:

  • name - The name of the test.
  • requests - a list of request objects (see below).

Possible members of a request object:

  • template - A template object for the request, by name.
  • request_method - A string containing the HTTP method to be used.
  • request_headers - An array of [header_name_string, header_value_string] arrays to emit in the request.
  • request_body - A string to use as the request body.
  • mode - The mode string to pass to fetch().
  • credentials - The credentials string to pass to fetch().
  • cache - The cache string to pass to fetch().
  • pause_after - Boolean controlling a 3-second pause after the request completes.
  • response_status - A [number, string] array containing the HTTP status code and phrase to return.
  • response_headers - An array of [header_name_string, header_value_string] arrays to emit in the response. These values will also be checked like expected_response_headers, unless there is a third value that is false. See below for special handling considerations.
  • response_body - String to send as the response body. If not set, it will contain the test identifier.
  • expected_type - One of ["cached", "not_cached", "lm_validate", "etag_validate", "error"]
  • expected_status - A number representing a HTTP status code to check the response for. If not set, the value of response_status[0] will be used; if that is not set, 200 will be used.
  • expected_request_headers - An array of [header_name_string, header_value_string] representing headers to check the request for.
  • expected_response_headers - An array of [header_name_string, header_value_string] representing headers to check the response for. See also response_headers.
  • expected_response_text - A string to check the response body against. If not present, response_body will be checked if present and non-null; otherwise the response body will be checked for the test uuid (unless the status code disallows a body). Set to null to disable all response body checking.

Some headers in response_headers are treated specially:

  • For date-carrying headers, if the value is a number, it will be interpreted as a delta to the time of the first request at the server.
  • For URL-carrying headers, the value will be appended as a query parameter for target.

See the source for exact details.