Page Speed Optimization Libraries
1.5.27.2
|
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. | |
GoogleString | ExtractCssBackgroundImage (const GoogleString &in_css) |
Extract the background image from the css text. | |
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 | |
Variable * | num_blocks_rewritten_ |
Variable * | num_fallback_rewrites_ |
Variable * | num_parse_failures_ |
Variable * | num_rewrites_dropped_ |
Variable * | total_bytes_saved_ |
Variable * | total_original_bytes_ |
Variable * | num_uses_ |
Variable * | num_flatten_imports_charset_mismatch_ |
Variable * | num_flatten_imports_invalid_url_ |
Variable * | num_flatten_imports_limit_exceeded_ |
Variable * | num_flatten_imports_minify_failed_ |
Variable * | num_flatten_imports_recursion_ |
Variable * | num_flatten_imports_complex_queries_ |
enum net_instaweb::CssRewriteTestBase::ValidationFlags [protected] |
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 |
|
kNoClearFetcher |
|
kNoOtherContexts |
|
kFlattenImportsCharsetMismatch |
Flags to the check various import flattening failure statistics. |
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.