OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |