net_instaweb::CssRewriteTestBase Class Reference

Inheritance diagram for net_instaweb::CssRewriteTestBase:
net_instaweb::ResourceManagerTestBase net_instaweb::HtmlParseTestBaseNoAlloc

List of all members.

Protected Types

enum  ValidationFlags {
  kExpectSuccess = 1, kExpectNoChange = 2, kExpectFallback = 4, kExpectFailure = 8,
  kNoStatCheck = 16, kNoClearFetcher = 32, kNoOtherContexts = 64, kLinkCharsetIsUTF8 = 128,
  kLinkScreenMedia = 256, kLinkPrintMedia = 512, kMetaCharsetUTF8 = 1024, kMetaCharsetISO88591 = 2048,
  kMetaHttpEquiv = 4096, kMetaHttpEquivUnquoted = 8192
}

Protected Member Functions

virtual void SetUp ()
bool FlagSet (int flags, ValidationFlags f)
void CheckFlags (int flags)
 Sanity check on flags passed in.
void ValidateRewriteInlineCss (const StringPiece &id, const StringPiece &css_input, const StringPiece &expected_css_output, int flags)
 Check that inline CSS gets rewritten correctly.
GoogleString ExpectedRewrittenUrl (const StringPiece &original_url, const StringPiece &expected_contents, const StringPiece &filter_id, const ContentType &content_type)
 Return the expected new URL with hash and all based on necessary data.
void GetNamerForCss (const StringPiece &id, const GoogleString &expected_css_output, ResourceNamer *namer)
GoogleString ExpectedUrlForNamer (const ResourceNamer &namer)
GoogleString ExpectedUrlForCss (const StringPiece &id, const GoogleString &expected_css_output)
void ValidateRewriteExternalCss (const StringPiece &id, const GoogleString &css_input, const GoogleString &expected_css_output, int flags)
 Check that external CSS gets rewritten correctly.
void ValidateRewriteExternalCssUrl (const StringPiece &css_url, const GoogleString &css_input, const GoogleString &expected_css_output, int flags)
void ValidateRewrite (const StringPiece &id, const GoogleString &css_input, const GoogleString &gold_output, int flags)
void ValidateFailParse (const StringPiece &id, const GoogleString &css_input)
void ResetStats ()
 Reset all Variables.
void ValidateWithStats (const StringPiece &id, const GoogleString &html_input, const GoogleString &expected_html_output, const StringPiece &css_input, const StringPiece &expected_css_output, int flags)
 Validate HTML rewrite as well as checking statistics.
void TestCorruptUrl (const char *junk)
 Helper to test for how we handle trailing junk.

Static Protected Member Functions

static bool ExactlyOneTrue (bool a, bool b)
static bool ExactlyOneTrue (bool a, bool b, bool c)
static bool ExactlyOneTrue (bool a, bool b, bool c, bool d)

Protected Attributes

Variablenum_blocks_rewritten_
Variablenum_parse_failures_
Variablenum_rewrites_dropped_
Variabletotal_bytes_saved_
Variabletotal_original_bytes_
Variablenum_uses_

Member Enumeration Documentation

Enumerator:
kExpectSuccess 

CSS parser succeeds and URL should be rewritten.

kExpectNoChange 

CSS parser succeeds but URL not rewritten because we increased the size of contents.

kExpectFallback 

CSS parser fails, fallback succeeds.

kExpectFailure 

CSS parser fails, fallback failed or disabled.

kNoStatCheck 
Todo:
TODO(sligocki): Explain why we turn off stats check at each use-site.
kNoClearFetcher 
Todo:
TODO(sligocki): Why would we ever want to clear fetcher?
kNoOtherContexts 
Todo:
TODO(sligocki): Explain why we turn off other contexts.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:33:58 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3