W3C

Guidelines for Web Content Transformation Proxies - Test Suite

This version:
http://dev.w3.org/2010/ct-guidelines/test-suite/
This document is an appendix to:
http://www.w3.org/2005/MWI/BPWG/Group/TaskForces/CT/editors-drafts/Guidelines/CR-ct-guidelines-20100427/
Latest version of "Guidelines for Web Content Transformation Proxies":
http://www.w3.org/TR/ct-guidelines/
Editor:
François Daoust, W3C
Contributors:
See Acknowledgments in Guidelines for Web Content Transformation Proxies.

Abstract

This document is an appendix to Guidelines for Web Content Transformation Proxies [CT-SPEC]. It provides an overview of the test suite for the document. The Working Group has developed this test suite so to have a test case for every testable assertion in the specification.

The Working Group encourages the public and members to contribute tests.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is derived from and is an appendix to Guidelines for Web Content Transformation Proxies [CT-SPEC], which is a draft document, produced by the Content Transformation Task Force of the Mobile Web Best Practices Working Group as part of the Mobile Web Initiative. Please see the "Status of this document" section of the corresponding guidelines specification [CT-SPEC] for complete details about the status of the guidelines version from which this is extracted and which it accompanies.

In particular, this test suite is work in progress and should be regarded as unstable.

Please send comments on this document to the Working Group's public email list public-bpwg-comments@w3.org, a publicly archived mailing list.


Introduction

This document defines tests for all the normative clauses of the Guidelines for Web Content Transformation Proxies [CT-SPEC]. The normative clauses are presented by order of their topic.

Tests

Assertion ta-49078 in section 4.1.1 Applicable HTTP Methods

If the HTTP method is altered from HEAD to GET, proxies should (providing such action is in accordance with normal HTTP caching rules) cache the response so that a second GET request for the same content is not required (see also 4.1.4 Serving Cached Responses ).

Tests for ta-49078

@@Test title and/or link to test file
@@Test description

Assertion ta-59418 in section 4.1.1 Applicable HTTP Methods

Other than to convert between HEAD and GET proxies must not alter request methods.

Tests for ta-59418

@@Test title and/or link to test file
@@Test description

Assertion ta-41855 in section 4.1.2 no-transform directive in Request

If the request contains a Cache-Control: no-transform directive, proxies must not alter the request other than to comply with transparent HTTP behavior defined in [RFC 2616 HTTP] sections section 14.9.5 and section 13.5.2 and to add header fields as described in 4.1.6 Additional HTTP Header Fields below.

Tests for ta-41855

@@Test title and/or link to test file
@@Test description

Assertion ta-17538 in section 4.1.4 Serving Cached Responses

[...] In this case proxies may for the sake of consistency of representation serve stale data but when doing so should notify the user that this is the case [...]

Tests for ta-17538

@@Test title and/or link to test file
@@Test description

Assertion ta-19789 in section 4.1.4 Serving Cached Responses

[...] and must provide a simple means of retrieving a fresh copy.

Tests for ta-19789

@@Test title and/or link to test file
@@Test description

Assertion ta-19234 in section 4.1.5 Alteration of HTTP Header Field Values

Other than the modifications required by [RFC 2616 HTTP] proxies should not modify the values of header fields other than the User-Agent, Accept, Accept-Charset, Accept-Encoding, and Accept-Language header fields [...]

Tests for ta-19234

@@Test title and/or link to test file
@@Test description

Assertion ta-13875 in section 4.1.5 Alteration of HTTP Header Field Values

[...] and must not delete header fields (see 4.1.5.5 Original Header Fields ).

Tests for ta-13875

@@Test title and/or link to test file
@@Test description

Assertion ta-5564 in section 4.1.5 Alteration of HTTP Header Field Values

Other than to comply with transparent HTTP operation, proxies should not modify any request header fields unless one of the following applies: [...]

Tests for ta-5564

@@Test title and/or link to test file
@@Test description

Assertion ta-32212 in section 4.1.5 Alteration of HTTP Header Field Values

It is emphasized that requests must not be altered in the presence of Cache-Control: no-transform as described under 4.1.2 no-transform directive in Request .

Tests for ta-32212

@@Test title and/or link to test file
@@Test description

Assertion ta-34769 in section 4.1.5 Alteration of HTTP Header Field Values

[...] Since the concept of "Web site" is not strictly defined, proxies should use heuristics including comparisons of domain name to assess whether resources form part of the same "Web site".

Tests for ta-34769

@@Test title and/or link to test file
@@Test description

Assertion ta-37267 in section 4.1.5.1 Content Tasting

While complying with this section (4.1.5 Alteration of HTTP Header Field Values) and section 4.2.5 Receipt of Vary HTTP Header Field proxies should avoid making repeated requests for the same resource.

Tests for ta-37267

@@Test title and/or link to test file
@@Test description

Assertion ta-8535 in section 4.1.5.2 Avoiding "Request Unacceptable" Responses

A proxy must not reissue a POST request as it is unsafe (see [RFC 2616 HTTP] Section 9.1.1 ).

Tests for ta-8535

@@Test title and/or link to test file
@@Test description

Assertion ta-38106 in section 4.1.5.3 User Selection of Restructured Experience

Proxies must assume that by default users will wish to receive a representation prepared by the Web site.

Tests for ta-38106

@@Test title and/or link to test file
@@Test description

Assertion ta-21844 in section 4.1.5.3 User Selection of Restructured Experience

[...] If a user has made such a choice then proxies may alter header field values when requesting resources in order to reflect that choice, but must, on receipt of an indication from a Web site that it offers alternative representations (see I.1.4.2 Indication of Intended Presentation Media Type of Representation ), inform the user of that and allow them to select an alternative representation.

Tests for ta-21844

@@Test title and/or link to test file
@@Test description

Assertion ta-38061 in section 4.1.5.3 User Selection of Restructured Experience

Proxies must assess whether a user's expressed preference for a restructured representation is still valid if a Web site changes its choice of representations (see 4.2.5 Receipt of Vary HTTP Header Field ).

Tests for ta-38061

@@Test title and/or link to test file
@@Test description

Assertion ta-46682 in section 4.1.5.4 Sequence of Requests

When requesting resources that are included resources (e.g. style sheets, images), proxies should make the request for such resources with the same User-Agent header field as the request for the resource from which they are referenced.

Tests for ta-46682

@@Test title and/or link to test file
@@Test description

Assertion ta-7181 in section 4.1.5.4 Sequence of Requests

When requesting linked resources that do not form part of the same Web site as the resource from which they are linked, proxies should not base their choice of header fields on a consistency of presentation premise.

Tests for ta-7181

@@Test title and/or link to test file
@@Test description

Assertion ta-65343 in section 4.1.5.5 Original Header Fields

When forwarding an HTTP request with altered HTTP header fields, in addition to complying with the rules of normal HTTP operation, proxies must include in the request additional fields of the form "X-Device-"<original header name> whose values are verbatim copies of the corresponding unaltered header field values, so that it is possible to reconstruct the original header fields.

Tests for ta-65343

@@Test title and/or link to test file
@@Test description

Assertion ta-23178 in section 4.1.5.5 Original Header Fields

Specifically the following mapping must be used: [...]

Tests for ta-23178

@@Test title and/or link to test file
@@Test description

Assertion ta-12437 in section 4.1.6 Additional HTTP Header Fields

proxies should add the IP address of the initiator of the request to the end of a comma separated list in an X-Forwarded-For HTTP header field; [...]

Tests for ta-12437

@@Test title and/or link to test file
@@Test description

Assertion ta-14351 in section 4.1.6 Additional HTTP Header Fields

proxies must (in accordance with RFC 2616) include a Via HTTP header field (see 4.1.6.1 Proxy Treatment of Via Header Field ).

Tests for ta-14351

@@Test title and/or link to test file
@@Test description

Assertion ta-49612 in section 4.1.6.1 Proxy Treatment of Via Header Field

Proxies should indicate their ability to transform content by including a comment in the Via HTTP header field consisting of the URI "http://www.

Tests for ta-49612

@@Test title and/or link to test file
@@Test description

Assertion ta-41044 in section 4.1.6.1 Proxy Treatment of Via Header Field

When forwarding Via header fields, proxies should not alter them by removing comments from them.

Tests for ta-41044

@@Test title and/or link to test file
@@Test description

Assertion ta-32045 in section 4.2 Proxy Forwarding of Response to User Agent

In the following, proxies must check for the presence of equivalent <meta http-equiv> elements in HTML content, if the relevant HTTP header field is not present.

Tests for ta-32045

@@Test title and/or link to test file
@@Test description

Assertion ta-14363 in section 4.2.1 User Preferences

Proxies must provide a means for users to express preferences for inhibiting content transformation even when content transformation has been chosen by the user as the default behavior.

Tests for ta-14363

@@Test title and/or link to test file
@@Test description

Assertion ta-21589 in section 4.2.1 User Preferences

[...] Those preferences must be maintained on a user by user and Web site by Web site basis.

Tests for ta-21589

@@Test title and/or link to test file
@@Test description

Assertion ta-1707 in section 4.2.1 User Preferences

Proxies must solicit re-expression of preferences in respect of a server if the server starts to indicate that it offers varying responses as discussed under 4.2.5 Receipt of Vary HTTP Header Field .

Tests for ta-1707

@@Test title and/or link to test file
@@Test description

Assertion ta-4894 in section 4.2.2 Receipt of Cache-Control: no-transform

If the response includes a Cache-Control: no-transform directive then proxies must not alter it other than to comply with transparent HTTP behavior as described in [RFC 2616 HTTP] Section 13.5.2 and Section 14.9.5 .

Tests for ta-4894

@@Test title and/or link to test file
@@Test description

Assertion ta-58567 in section 4.2.5 Receipt of Vary HTTP Header Field

[...] However, if it makes a request with altered header fields in these circumstances, and receives a response containing a Vary header field referring to one of the altered header fields then it should request the resource again with unaltered header fields.

Tests for ta-58567

@@Test title and/or link to test file
@@Test description

Assertion ta-52209 in section 4.2.5 Receipt of Vary HTTP Header Field

[...] It should also update whatever heuristics it uses so that unaltered header fields are presented first in subsequent requests for this resource.

Tests for ta-52209

@@Test title and/or link to test file
@@Test description

Assertion ta-43424 in section 4.2.6 Link to "handheld" Representation

If the response is an HTML response and it contains a <link rel="alternate" media="handheld" /> element (and the user agent is determined as being "handheld"), a proxy should request and process the referenced resource, unless the resource referenced is the current representation .

Tests for ta-43424

@@Test title and/or link to test file
@@Test description

Assertion ta-43472 in section 4.2.7 WML Content

If the content is WML proxies should act in a transparent manner.

Tests for ta-43472

@@Test title and/or link to test file
@@Test description

Assertion ta-64788 in section 4.2.8 Proxy Decision to Transform

In the absence of a Vary or no-transform directive (or a meta HTTP-Equiv element containing Cache-Control: no-transform) proxies should not transform content matching any of the following rules unless the user has specifically requested transformation: [...]

Tests for ta-64788

@@Test title and/or link to test file
@@Test description

Assertion ta-34526 in section 4.2.8.1 Alteration of Response

It must add a Warning 214 Transformation Applied HTTP header field; [...]

Tests for ta-34526

@@Test title and/or link to test file
@@Test description

Assertion ta-55014 in section 4.2.8.1 Alteration of Response

The altered content should validate according to an appropriate published formal grammar [...]

Tests for ta-55014

@@Test title and/or link to test file
@@Test description

Assertion ta-10803 in section 4.2.8.1 Alteration of Response

[...] and if XML must be well-formed ; [...]

Tests for ta-10803

@@Test title and/or link to test file
@@Test description

Assertion ta-39889 in section 4.2.8.1 Alteration of Response

It should indicate to the user that the content has been transformed for mobile presentation and provide an option to view the original, unmodified content.

Tests for ta-39889

@@Test title and/or link to test file
@@Test description

Assertion ta-5078 in section 4.2.8.2 Link Rewriting

Proxies must not rewrite links when content transformation is prohibited.

Tests for ta-5078

@@Test title and/or link to test file
@@Test description

Assertion ta-18105 in section 4.2.8.2 Link Rewriting

Proxies must preserve security between requests for domains that are not same-origin in respect of cookies and scripts.

Tests for ta-18105

@@Test title and/or link to test file
@@Test description

Assertion ta-43818 in section 4.2.8.3 HTTPS Link Rewriting

The practice of intercepting HTTPS links is strongly NOT RECOMMENDED .

Tests for ta-43818

@@Test title and/or link to test file
@@Test description

Assertion ta-26858 in section 4.2.8.3 HTTPS Link Rewriting

If a proxy rewrites HTTPS links, it must advise the user of the security implications of doing so [...]

Tests for ta-26858

@@Test title and/or link to test file
@@Test description

Assertion ta-17637 in section 4.2.8.3 HTTPS Link Rewriting

[...] and must provide the option to bypass it and to communicate with the server directly.

Tests for ta-17637

@@Test title and/or link to test file
@@Test description

Assertion ta-53227 in section 4.2.8.3 HTTPS Link Rewriting

Notwithstanding anything else in this document, proxies must not rewrite HTTPS links in the presence of a Cache-Control: no-transform directive.

Tests for ta-53227

@@Test title and/or link to test file
@@Test description

Assertion ta-36041 in section 4.2.8.3 HTTPS Link Rewriting

If a proxy rewrites HTTPS links, replacement links must have the scheme https .

Tests for ta-36041

@@Test title and/or link to test file
@@Test description

Assertion ta-40493 in section 4.2.8.3 HTTPS Link Rewriting

When forwarding requests originating from HTTPS links proxies must include a Via header field as discussed under 4.1.6.1 Proxy Treatment of Via Header Field .

Tests for ta-40493

@@Test title and/or link to test file
@@Test description

Assertion ta-10117 in section 4.2.8.3 HTTPS Link Rewriting

When forwarding responses from servers proxies must notify the user of invalid server certificates.

Tests for ta-10117

@@Test title and/or link to test file
@@Test description

Assertion ta-58462 in section 5 Testing (Normative)

Operators of content transformation proxies should make available an interface through which the functions of the proxy can be exercised.

Tests for ta-58462

@@Test title and/or link to test file
@@Test description

Assertion ta-4172 in section 5 Testing (Normative)

[...] The operations possible through this interface must cover those necessary to settle the outcome of all conformance statements listed in section B.

Tests for ta-4172

@@Test title and/or link to test file
@@Test description

Assertion ta-23958 in section 5 Testing (Normative)

The interface must be reachable from terminals with browsing capabilities connected to the Web via a conventional Internet access environment at the tester's premises; [...]

Tests for ta-23958

@@Test title and/or link to test file
@@Test description

Assertion ta-1181 in section 5 Testing (Normative)

Such access must be granted under fair, reasonable and non-discriminatory conditions.

Tests for ta-1181

@@Test title and/or link to test file
@@Test description

References

CT-SPEC
Guidelines for Web Content Transformation Proxies, Jo Rabin, mTLD Top Level Domain (dotMobi), Working Draft, http://www.w3.org/2005/MWI/BPWG/Group/TaskForces/CT/editors-drafts/Guidelines/CR-ct-guidelines-20100427/.