Page Speed Optimization Libraries  1.2.24.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
net_instaweb::FetcherTest Class Reference

List of all members.

Classes

class  CheckCallback
class  MockAsyncFetcher
class  MockFetcher
 Helpful classes for testing. More...

Protected Member Functions

int CountFetchesSync (const StringPiece &url, bool expect_success, bool check_error_message)
int CountFetchesSync (const StringPiece &url, UrlFetcher *fetcher, bool expect_success, bool check_error_message)
 Use an explicit fetcher (you don't need to override sync_fetcher()).
int CountFetchesAsync (const StringPiece &url, bool expect_success, bool *callback_called)
virtual UrlFetchersync_fetcher ()
virtual UrlAsyncFetcherasync_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)

Protected Attributes

GoogleMessageHandler message_handler_
MockFetcher mock_fetcher_
MockAsyncFetcher mock_async_fetcher_

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 SimpleStatsstatistics_

Member Function Documentation

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 mock fetcher had to be run to perform the fetch. Note: You must override async_fetcher() to return the correct fetcher.

int net_instaweb::FetcherTest::CountFetchesSync ( const StringPiece &  url,
bool  expect_success,
bool  check_error_message 
) [protected]

Do a URL fetch, and return the number of times the mock fetcher had to be run to perform the fetch. Note: You must override sync_fetcher() to return the correct fetcher.

virtual UrlFetcher* net_instaweb::FetcherTest::sync_fetcher ( ) [inline, protected, virtual]

Override these to allow CountFetchesSync or Async respectively. These are not abstract (= 0) because they only need to be overridden by classes which want to use CountFetchersSync/Async without specifying the fetcher in each call.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines