Page Speed Optimization Libraries
1.8.31.2
|
Classes | |
class | CheckCallback |
Protected Member Functions | |
WaitUrlAsyncFetcher * | wait_fetcher () |
Helpful classes for testing. | |
CountingUrlAsyncFetcher * | counting_fetcher () |
int | CountFetchesAsync (const StringPiece &url, bool expect_success, bool *callback_called) |
int | CountFetchesAsync (const StringPiece &url, UrlAsyncFetcher *fetcher, bool expect_success, bool check_error_message, bool *callback_called) |
virtual UrlAsyncFetcher * | async_fetcher () |
GoogleString | TestFilename () |
void | ValidateOutput (const GoogleString &content, const ResponseHeaders &response_headers) |
Static Protected Member Functions | |
static void | SetUpTestCase () |
static void | TearDownTestCase () |
static void | ValidateMockFetcherResponse (bool success, bool check_error_message, const GoogleString &content, const ResponseHeaders &response_headers) |
This checks that response matches the mock response we setup. | |
Protected Attributes | |
GoogleMessageHandler | message_handler_ |
MockUrlFetcher | mock_fetcher_ |
WaitUrlAsyncFetcher | wait_url_async_fetcher_ |
CountingUrlAsyncFetcher | counting_fetcher_ |
scoped_ptr< ThreadSystem > | thread_system_ |
Static Protected Attributes | |
static const char | kStartDate [] |
static const char | kHtmlContent [] |
static const char | kGoodUrl [] |
static const char | kNotCachedUrl [] |
static const char | kBadUrl [] |
static const char | kHeaderName [] |
static const char | kHeaderValue [] |
static const char | kErrorMessage [] |
static SimpleStats * | statistics_ |
virtual UrlAsyncFetcher* net_instaweb::FetcherTest::async_fetcher | ( | ) | [inline, protected, virtual] |
Override this to allow CountFetchesAsync w/o fetcher argument. It is not abstract (= 0) because they only need to be overridden by classes which want to use CountFetchersAsync.
int net_instaweb::FetcherTest::CountFetchesAsync | ( | const StringPiece & | url, |
bool | expect_success, | ||
bool * | callback_called | ||
) | [protected] |
Initiate an async URL fetch, and return the number of times the counting fetcher had to be run to perform the fetch. Note: You must override async_fetcher() to return the correct fetcher.
int net_instaweb::FetcherTest::CountFetchesAsync | ( | const StringPiece & | url, |
UrlAsyncFetcher * | fetcher, | ||
bool | expect_success, | ||
bool | check_error_message, | ||
bool * | callback_called | ||
) | [protected] |
Like above, but doesn't use async_fetcher(), and lets you opt-out of checking of error messages
void net_instaweb::FetcherTest::ValidateOutput | ( | const GoogleString & | content, |
const ResponseHeaders & | response_headers | ||
) | [protected] |
This validation code is hard-coded to the http request capture in testdata/google.http.
WaitUrlAsyncFetcher* net_instaweb::FetcherTest::wait_fetcher | ( | ) | [inline, protected] |
Helpful classes for testing.
We set up a chain of fetchers: Counting -> Wait -> Mock, where the mock will only fetch kGoodUrl and kNotCachedUrl, returning kHtmlContent.