|
virtual TestRewriteDriverFactory * | MakeTestFactory () |
|
OptionsClass * | NewOptions () |
|
OptionsClass * | options () |
| Non-virtual override of options method defined in RewriteTestBase.
|
|
| RewriteTestBase (std::pair< TestRewriteDriverFactory *, TestRewriteDriverFactory * > factories) |
|
virtual void | SetUp () |
|
virtual void | TearDown () |
|
virtual bool | AddBody () const |
|
void | AddRecompressImageFilters () |
|
void | AddFilter (RewriteOptions::Filter filter) |
| Add a single rewrite filter to rewrite_driver_.
|
|
void | AddOtherFilter (RewriteOptions::Filter filter) |
| Add a single rewrite filter to other_rewrite_driver_.
|
|
void | AddRewriteFilter (RewriteFilter *filter) |
|
void | AddFetchOnlyRewriteFilter (RewriteFilter *filter) |
|
void | AddOtherRewriteFilter (RewriteFilter *filter) |
|
void | SetBaseUrlForFetch (const StringPiece &url) |
|
void | SetDriverRequestHeaders () |
|
void | SetDownstreamCacheDirectives (StringPiece downstream_cache_purge_method, StringPiece downstream_cache_purge_location_prefix, StringPiece rebeaconing_key) |
|
void | SetShouldBeaconHeader (StringPiece rebeaconing_key) |
| Set ShouldBeacon request header to the specified value.
|
|
ResourcePtr | CreateResource (const StringPiece &base, const StringPiece &url) |
|
Timer * | timer () |
|
void | AppendDefaultHeaders (const ContentType &content_type, GoogleString *text) |
| Append default headers to the given string.
|
|
void | AppendDefaultHeadersWithCanonical (const ContentType &content_type, StringPiece canonical_url, GoogleString *text) |
| Like above, but also include a Link: <..>; rel="canonical" header.
|
|
void | ServeResourceFromManyContexts (const GoogleString &resource_url, const StringPiece &expected_content) |
|
void | ServeResourceFromManyContextsWithUA (const GoogleString &resource_url, const StringPiece &expected_content, const StringPiece &user_agent) |
|
void | ServeResourceFromNewContext (const GoogleString &resource_url, const StringPiece &expected_content) |
|
virtual RewriteDriver * | html_parse () |
|
void | DefaultResponseHeaders (const ContentType &content_type, int64 ttl_sec, ResponseHeaders *response_headers) |
| Set default headers for a resource with content_type and Cache ttl_sec.
|
|
bool | FetchResource (const StringPiece &path, const StringPiece &filter_id, const StringPiece &name, const StringPiece &ext, GoogleString *content) |
|
bool | FetchResource (const StringPiece &path, const StringPiece &filter_id, const StringPiece &name, const StringPiece &ext, GoogleString *content, ResponseHeaders *response) |
|
bool | FetchResourceUrl (const StringPiece &url, GoogleString *content, ResponseHeaders *response) |
|
bool | FetchResourceUrl (const StringPiece &url, RequestHeaders *request_headers, GoogleString *content, ResponseHeaders *response_headers) |
|
bool | FetchResourceUrl (const StringPiece &url, GoogleString *content) |
|
bool | TryFetchResource (const StringPiece &url) |
| Just check if we can fetch a resource successfully, ignore response.
|
|
void | SetUseManagedRewriteDrivers (bool use_managed_rewrite_drivers) |
|
GoogleString | CssLinkHref (const StringPiece &url) |
|
void | CollectCssLinks (const StringPiece &id, const StringPiece &html, StringVector *css_links) |
| Collects the hrefs for all CSS <link>s on the page.
|
|
void | CollectCssLinks (const StringPiece &id, const StringPiece &html, CssLink::Vector *css_links) |
| Collects all information about CSS links into a CssLink::Vector.
|
|
void | EncodePathAndLeaf (const StringPiece &filter_id, const StringPiece &hash, const StringVector &name_vector, const StringPiece &ext, ResourceNamer *namer) |
| Encode the given name (path + leaf) using the given pagespeed attributes.
|
|
StringVector | MultiUrl (const StringPiece &url1) |
|
StringVector | MultiUrl (const StringPiece &url1, const StringPiece &url2) |
|
StringVector | MultiUrl (const StringPiece &url1, const StringPiece &url2, const StringPiece &url3) |
|
StringVector | MultiUrl (const StringPiece &url1, const StringPiece &url2, const StringPiece &url3, const StringPiece &url4) |
|
GoogleString | Encode (const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringPiece &name, const StringPiece &ext) |
|
GoogleString | Encode (const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringVector &name_vector, const StringPiece &ext) |
|
GoogleString | EncodeNormal (const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringPiece &name, const StringPiece &ext) |
| Same as Encode but specifically using UrlNamer not TestUrlNamer.
|
|
GoogleString | EncodeNormal (const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringVector &name_vector, const StringPiece &ext) |
|
GoogleString | EncodeWithBase (const StringPiece &base, const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringPiece &name, const StringPiece &ext) |
|
GoogleString | EncodeWithBase (const StringPiece &base, const StringPiece &path, const StringPiece &filter_id, const StringPiece &hash, const StringVector &name_vector, const StringPiece &ext) |
|
GoogleString | EncodeImage (int width, int height, StringPiece filename, StringPiece hash, StringPiece rewritten_ext) |
|
GoogleString | AddOptionsToEncodedUrl (const StringPiece &url, const StringPiece &options) |
| Takes an already-encoded URL and adds options to to it.
|
|
void | SetupWaitFetcher () |
|
void | CallFetcherCallbacks () |
|
void | OtherCallFetcherCallbacks () |
|
RewriteOptions * | options () const |
|
RewriteOptions * | other_options () const |
|
void | SetRewriteOptions (RewriteOptions *opts) |
| Set the RewriteOptions to be returned by the RewriteOptionsManager.
|
|
bool | AddDomain (StringPiece domain) |
|
bool | AddOriginDomainMapping (StringPiece to_domain, StringPiece from_domain) |
|
bool | AddRewriteDomainMapping (StringPiece to_domain, StringPiece from_domain) |
|
bool | AddShard (StringPiece domain, StringPiece shards) |
|
void | TestServeFiles (const ContentType *content_type, const StringPiece &filter_id, const StringPiece &rewritten_ext, const StringPiece &orig_name, const StringPiece &orig_content, const StringPiece &rewritten_name, const StringPiece &rewritten_content) |
| Helper method to test all manner of resource serving from a filter.
|
|
void | ValidateFallbackHeaderSanitization (StringPiece filter_id) |
|
TestRewriteDriverFactory * | factory () |
|
TestRewriteDriverFactory * | other_factory () |
|
void | UseMd5Hasher () |
|
void | SetDefaultLongCacheHeaders (const ContentType *content_type, ResponseHeaders *header) |
|
void | SetFetchResponse (const StringPiece &url, const ResponseHeaders &response_header, const StringPiece &response_body) |
|
void | SetResponseWithDefaultHeaders (const StringPiece &relative_url, const ContentType &content_type, const StringPiece &content, int64 ttl_sec) |
| Add content to mock fetcher (with default headers).
|
|
bool | LoadFile (const StringPiece &filename, GoogleString *contents) |
|
void | AddFileToMockFetcher (const StringPiece &url, const StringPiece &filename, const ContentType &content_type, int64 ttl_sec) |
| Add the contents of a file to mock fetcher (with default headers).
|
|
void | AddToResponse (const StringPiece &url, const StringPiece &name, const StringPiece &value) |
|
void | SetFetchResponse404 (const StringPiece &url) |
|
void | SetFetchFailOnUnexpected (bool fail) |
|
void | FetcherUpdateDateHeaders () |
|
void | ClearFetcherResponses () |
|
virtual void | ClearStats () |
|
void | ClearRewriteDriver () |
|
MockUrlFetcher * | mock_url_fetcher () |
|
Hasher * | hasher () |
|
DelayCache * | delay_cache () |
|
LRUCache * | lru_cache () |
|
Statistics * | statistics () |
|
MemFileSystem * | file_system () |
|
HTTPCache * | http_cache () |
|
PropertyCache * | page_property_cache () |
|
MockMessageHandler * | message_handler () |
|
RewriteDriver * | rewrite_driver () |
|
RewriteDriver * | other_rewrite_driver () |
|
MockScheduler * | mock_scheduler () |
| The scheduler used by rewrite_driver.
|
|
int64 | start_time_ms () const |
|
bool | ReadFile (const char *filename, GoogleString *contents) |
|
bool | WriteFile (const char *filename, const StringPiece &contents) |
|
ServerContext * | server_context () |
|
ServerContext * | other_server_context () |
|
CountingUrlAsyncFetcher * | counting_url_async_fetcher () |
|
void | SetMockHashValue (const GoogleString &value) |
|
void | SetCacheDelayUs (int64 delay_us) |
|
void | SetupWriter () override |
|
RewriteDriver * | MakeDriver (ServerContext *server_context, RewriteOptions *options) |
|
GoogleString | AbsolutifyUrl (const StringPiece &in) |
| Converts a potentially relative URL off kTestDomain to absolute if needed.
|
|
void | TestRetainExtraHeaders (const StringPiece &name, const StringPiece &filter_id, const StringPiece &ext) |
|
const UrlSegmentEncoder * | FindEncoder (const StringPiece &id) const |
|
void | SetUseTestUrlNamer (bool use_test_url_namer) |
| Switch url namers as specified.
|
|
GoogleString | EncodeCssName (const StringPiece &name, bool supports_webp, bool can_inline) |
|
bool | ReadIfCached (const ResourcePtr &resource) |
|
void | InitiateResourceRead (const ResourcePtr &resource) |
|
HTTPCache::FindResult | HttpBlockingFind (const GoogleString &key, HTTPCache *http_cache, HTTPValue *value_out, ResponseHeaders *headers) |
|
HTTPCache::FindResult | HttpBlockingFindStatus (const GoogleString &key, HTTPCache *http_cache) |
|
HTTPCache::FindResult | HttpBlockingFindWithOptions (const RewriteOptions *options, const GoogleString &key, HTTPCache *http_cache, HTTPValue *value_out, ResponseHeaders *headers) |
| Same as above, but with options (for invalidation checks)
|
|
void | SetXhtmlMimetype () |
| Sets the response-headers Content-Type to "application/xhtml+xml".
|
|
void | SetHtmlMimetype () |
| Sets the response-headers Content-Type to "text/html".
|
|
void | SetMimetype (const StringPiece &mimetype) |
| Sets the response-headers Content-Type as specified.
|
|
void | CheckFetchFromHttpCache (StringPiece url, StringPiece expected_contents, int64 expected_expiration_ms) |
|
const PropertyCache::Cohort * | SetupCohort (PropertyCache *cache, const GoogleString &cohort) |
| Setup statistics for the given cohort and add it to the give PropertyCache.
|
|
void | SetupSharedCache () |
|
MockPropertyPage * | NewMockPage (const StringPiece &url, const StringPiece &options_signature_hash, UserAgentMatcher::DeviceType device_type) |
| Returns a new mock property page for the page property cache.
|
|
MockPropertyPage * | NewMockPage (const StringPiece &url) |
|
void | SetMockLogRecord () |
| Sets MockLogRecord in the driver's request_context.
|
|
MockLogRecord * | mock_log_record () |
| Returns the MockLogRecord in the driver.
|
|
GoogleString | GetLazyloadScriptHtml () |
| Helper methods to return js/html snippets related to lazyload images.
|
|
GoogleString | GetLazyloadPostscriptHtml () |
|
void | SetCacheInvalidationTimestamp () |
|
void | SetCacheInvalidationTimestampForUrl (StringPiece url, bool ignores_metadata_and_pcache) |
|
void | EnableCachePurge () |
|
void | EnableDebug () |
| Enables the debug flag, which is often done on a test-by-test basis.
|
|
void | DebugWithMessage (StringPiece expected_debug_message) |
|
GoogleString | DebugMessage (StringPiece url) |
|
void | DisableGzip () |
|
bool | WasGzipped (const ResponseHeaders &response_headers) |
| Determines whether a response was originally gzipped.
|
|
ThreadSystem * | thread_system () |
|
OptionsClass * | NewOptions () |
|
|
enum | ActiveServerFlag { kPrimary,
kSecondary
} |
|
static GoogleString | ChangeSuffix (StringPiece old_url, bool append_new_suffix, StringPiece old_suffix, StringPiece new_suffix) |
|
static const ProcessContext & | process_context () |
|
scoped_ptr< ThreadSystem > | thread_system_ |
|
static const char | kTestData [] |
| Testdata directory.
|
|
static const char | kConfiguredBeaconingKey [] |
| Beaconing key values used when downstream caching is enabled.
|
|
static const char | kWrongBeaconingKey [] |
|
void | Init () |
|
virtual RequestContextPtr | CreateRequestContext () |
|
void | CallFetcherCallbacksForDriver (WaitUrlAsyncFetcher *fetcher, RewriteDriver *driver) |
|
void | PopulateDefaultHeaders (const ContentType &content_type, int64 original_content_length, ResponseHeaders *headers) |
|
void | SetActiveServer (ActiveServerFlag server_to_use) |
|
void | AdvanceTimeUs (int64 delay_ms) |
|
void | AdvanceTimeMs (int64 delay_ms) |
|
void | SetTimeUs (int64 time_us) |
|
void | SetTimeMs (int64 time_ms) |
|
void | AdjustTimeUsWithoutWakingAlarms (int64 time_us) |
| Adjusts time ignoring any scheduler callbacks. Use with caution.
|
|
const RequestTimingInfo & | timing_info () |
| Accessor for TimingInfo.
|
|
RequestTimingInfo * | mutable_timing_info () |
|
virtual RequestContextPtr | request_context () |
|
LoggingInfo * | logging_info () |
|
const MetadataCacheInfo & | metadata_cache_info () |
| Convenience method to extract read-only metadata_cache_info.
|
|
GoogleString | AppliedRewriterStringFromLog () |
|
void | VerifyRewriterInfoEntry (AbstractLogRecord *log_record, const GoogleString &id, int url_index, int rewriter_info_index, int rewriter_info_size, int url_list_size, const GoogleString &url) |
|
void | SetCurrentUserAgent (const StringPiece &user_agent) |
| Sets current_user_agent_.
|
|
void | SetupForWebp () |
| Sets up user-agent and request-header to allow webp processing.
|
|
void | SetupForWebpLossless () |
|
void | SetupForWebpAnimated () |
|
void | AddRequestAttribute (StringPiece name, StringPiece value) |
|
void | PopulateRequestHeaders (RequestHeaders *request_headers) |
| Populates a RequestHeaders* object with al.
|
|
virtual void | ParseUrl (StringPiece url, StringPiece html_input) |
|
GoogleString | ExpectedNonce () |
|
GoogleString | HttpCacheKey (StringPiece url) |
|
int | TimedValue (StringPiece name) |
| Returns the value of a TimedVariable, specified by name.
|
|
virtual bool | AddHtmlTags () const |
|
void | SetDoctype (StringPiece directive) |
|
virtual GoogleString | AddHtmlBody (StringPiece html) |
|
void | ValidateNoChanges (StringPiece case_id, StringPiece html_input) |
|
void | ValidateNoChangesFail (StringPiece case_id, StringPiece html_input) |
| Fail to ValidateNoChanges.
|
|
void | SetupWriter (scoped_ptr< HtmlWriterFilter > *html_writer_filter) |
|
void | Parse (StringPiece case_id, StringPiece html_input) |
| Parse html_input, the result is stored in output_buffer_. More...
|
|
bool | ValidateExpected (StringPiece case_id, StringPiece html_input, StringPiece expected) |
|
bool | ValidateExpectedUrl (StringPiece url, StringPiece html_input, StringPiece expected) |
| Same as ValidateExpected, but with an explicit URL rather than an id.
|
|
void | ValidateExpectedFail (StringPiece case_id, StringPiece html_input, StringPiece expected) |
| Fail to ValidateExpected.
|
|
const GoogleUrl & | html_gurl () |
|
const HTTPCache::FindResult | kFoundResult |
| Common values for HttpBlockingFind* result.
|
|
const HTTPCache::FindResult | kNotFoundResult |
|
MockUrlFetcher | mock_url_fetcher_ |
|
scoped_ptr< Statistics > | statistics_ |
|
scoped_ptr
< TestRewriteDriverFactory > | factory_ |
|
scoped_ptr
< TestRewriteDriverFactory > | other_factory_ |
|
ServerContext * | server_context_ |
|
RewriteDriver * | rewrite_driver_ |
|
ServerContext * | other_server_context_ |
|
RewriteDriver * | other_rewrite_driver_ |
|
scoped_ptr< HtmlWriterFilter > | other_html_writer_filter_ |
|
ActiveServerFlag | active_server_ |
|
bool | use_managed_rewrite_drivers_ |
|
StringPiece | current_user_agent_ |
|
StringVector | request_attribute_names_ |
|
StringVector | request_attribute_values_ |
|
MD5Hasher | md5_hasher_ |
|
RewriteOptions * | options_ |
| owned by rewrite_driver_.
|
|
RewriteOptions * | other_options_ |
| owned by other_rewrite_driver_.
|
|
UrlSegmentEncoder | default_encoder_ |
|
ResponseHeaders | response_headers_ |
|
const GoogleString | kEtag0 |
| Etag with a 0 hash.
|
|
uint64 | expected_nonce_ |
|
GoogleString | debug_message_ |
| Message used by DebugMessage.
|
|
MockMessageHandler | message_handler_ |
|
StringWriter | write_to_string_ |
|
GoogleString | output_buffer_ |
|
bool | added_filter_ |
|
scoped_ptr< HtmlWriterFilter > | html_writer_filter_ |
|
GoogleString | doctype_string_ |
|
static const char | kTestDomain [] |
|
static const char | kXhtmlDtd [] |
| DOCTYPE string for claiming XHTML.
|
|