Page Speed Optimization Libraries  1.3.25.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
net_instaweb::CssRewriteTestBase Class Reference
Inheritance diagram for net_instaweb::CssRewriteTestBase:
net_instaweb::RewriteTestBase net_instaweb::RewriteOptionsTestBase< OptionsClass > net_instaweb::HtmlParseTestBaseNoAlloc

List of all members.

Protected Types

enum  ValidationFlags {
  kNoFlags = 0, 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, kFlattenImportsCharsetMismatch = 1<<14,
  kFlattenImportsInvalidUrl = 1<<15, kFlattenImportsLimitExceeded = 1<<16, kFlattenImportsMinifyFailed = 1<<17, kFlattenImportsRecursion = 1<<18,
  kFlattenImportsComplexQueries = 1<<19
}

Protected Member Functions

virtual void SetUp ()
bool FlagSet (int flags, ValidationFlags f)
void CheckFlags (int flags)
 Sanity check on flags passed in.
bool 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)
GoogleString MakeHtmlWithExternalCssLink (const StringPiece &css_url, int flags)
 Makes an HTML document with an external CSS link.
GoogleString MakeIndentedCssWithImage (StringPiece image_url)
 Makes a CSS body with an external image link, with nice indentation.
GoogleString MakeMinifiedCssWithImage (StringPiece image_url)
 Makes a minified CSS body with an external image link.
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.
bool 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_fallback_rewrites_
Variablenum_parse_failures_
Variablenum_rewrites_dropped_
Variabletotal_bytes_saved_
Variabletotal_original_bytes_
Variablenum_uses_
Variablenum_flatten_imports_charset_mismatch_
Variablenum_flatten_imports_invalid_url_
Variablenum_flatten_imports_limit_exceeded_
Variablenum_flatten_imports_minify_failed_
Variablenum_flatten_imports_recursion_
Variablenum_flatten_imports_complex_queries_

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.
kFlattenImportsCharsetMismatch 

Flags to the check various import flattening failure statistics.


Member Function Documentation

void net_instaweb::CssRewriteTestBase::ValidateRewrite ( const StringPiece &  id,
const GoogleString css_input,
const GoogleString gold_output,
int  flags 
) [inline, protected]

Don't run for external CSS unless inline succeeds.


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