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

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

Issue 318723004: Test and css changes for dom_distiller inclusion of video. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/dom_distiller/core/css/distilledpage.css » ('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 e319097bd4196c2b155d0242da97e72e93166e9e..e8c1efa842f88161db78c748a9c0fdb0a3d5d965 100644
--- a/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
+++ b/components/dom_distiller/content/distiller_page_web_contents_browsertest.cc
@@ -28,6 +28,7 @@ using testing::Not;
namespace dom_distiller {
const char* kSimpleArticlePath = "/simple_article.html";
+const char* kVideoArticlePath = "/video_article.html";
class DistillerPageWebContentsTest : public ContentBrowserTest {
public:
@@ -217,6 +218,32 @@ IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, HandlesRelativeImages) {
HasSubstr("src=\"http://www.google.com/absoluteimage.png\""));
}
+
+IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, HandlesRelativeVideos) {
+ DistillerPageWebContents distiller_page(
+ shell()->web_contents()->GetBrowserContext(),
+ scoped_ptr<SourcePageHandleWebContents>());
+ distiller_page_ = &distiller_page;
+
+ base::RunLoop run_loop;
+ DistillPage(run_loop.QuitClosure(), kVideoArticlePath);
+ run_loop.Run();
+
+ // A relative source/track should've been updated.
+ EXPECT_THAT(
+ page_info_.get()->html,
+ ContainsRegex("src=\"http://127.0.0.1:.*/relative_video.mp4\""));
+ EXPECT_THAT(
+ page_info_.get()->html,
+ ContainsRegex("src=\"http://127.0.0.1:.*/relative_track_en.vtt\""));
+ EXPECT_THAT(
+ page_info_.get()->html,
+ HasSubstr("src=\"http://www.google.com/absolute_video.ogg\""));
+ EXPECT_THAT(
+ page_info_.get()->html,
+ HasSubstr("src=\"http://www.google.com/absolute_track_fr.vtt\""));
+}
+
IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, VisibilityDetection) {
DistillerPageWebContents distiller_page(
shell()->web_contents()->GetBrowserContext(),
« no previous file with comments | « no previous file | components/dom_distiller/core/css/distilledpage.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698