Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc

Issue 278873003: add test for visibility detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/test/data/dom_distiller/invisible_style.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
diff --git a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
index 3d20a9d9137e2ddd089d008006a8f12862a0a3d9..72b572f4ff3ac1aed703e71f1193757bdaf8c339 100644
--- a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
+++ b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
@@ -118,4 +118,27 @@ IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, HandlesRelativeImages) {
HasSubstr("src=\"http://www.google.com/absoluteimage.png\""));
}
+IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, VisibilityDetection) {
+ DistillerPageWebContents distiller_page(
+ shell()->web_contents()->GetBrowserContext());
+ distiller_page_ = &distiller_page;
+
+ // visble_style.html and invisible_style.html only differ by the visibility
+ // internal stylesheet.
+
+ {
+ base::RunLoop run_loop;
+ DistillPage(run_loop.QuitClosure(), "/visible_style.html");
+ run_loop.Run();
+ EXPECT_THAT(page_info_.get()->html, HasSubstr("Lorem ipsum"));
+ }
+
+ {
+ base::RunLoop run_loop;
+ DistillPage(run_loop.QuitClosure(), "/invisible_style.html");
+ run_loop.Run();
+ EXPECT_THAT(page_info_.get()->html, Not(HasSubstr("Lorem ipsum")));
+ }
+}
+
} // namespace dom_distiller
« no previous file with comments | « no previous file | components/test/data/dom_distiller/invisible_style.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698