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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | components/test/data/dom_distiller/simple_article.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/weak_ptr.h" 5 #include "base/memory/weak_ptr.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "components/dom_distiller/content/distiller_page_web_contents.h" 9 #include "components/dom_distiller/content/distiller_page_web_contents.h"
10 #include "components/dom_distiller/core/distiller_page.h" 10 #include "components/dom_distiller/core/distiller_page.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 DistillPage(run_loop.QuitClosure(), "/simple_article.html"); 111 DistillPage(run_loop.QuitClosure(), "/simple_article.html");
112 run_loop.Run(); 112 run_loop.Run();
113 113
114 // A relative link should've been updated. 114 // A relative link should've been updated.
115 EXPECT_THAT(page_info_.get()->html, 115 EXPECT_THAT(page_info_.get()->html,
116 ContainsRegex("src=\"http://127.0.0.1:.*/relativeimage.png\"")); 116 ContainsRegex("src=\"http://127.0.0.1:.*/relativeimage.png\""));
117 EXPECT_THAT(page_info_.get()->html, 117 EXPECT_THAT(page_info_.get()->html,
118 HasSubstr("src=\"http://www.google.com/absoluteimage.png\"")); 118 HasSubstr("src=\"http://www.google.com/absoluteimage.png\""));
119 } 119 }
120 120
121 IN_PROC_BROWSER_TEST_F(DistillerPageWebContentsTest, VisibilityDetection) {
122 DistillerPageWebContents distiller_page(
123 shell()->web_contents()->GetBrowserContext());
124 distiller_page_ = &distiller_page;
125
126 base::RunLoop run_loop;
127 DistillPage(run_loop.QuitClosure(), "/simple_article.html");
128 run_loop.Run();
129
130 EXPECT_THAT(page_info_.get()->html,
131 Not(HasSubstr("I am not supposed to appear")));
cjhopman 2014/05/14 16:59:52 This test needs to ensure that when those elements
kuan 2014/05/14 18:57:24 Done. i'm not sure if this is what u meant.
132 }
133
121 } // namespace dom_distiller 134 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « no previous file | components/test/data/dom_distiller/simple_article.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698