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

Side by Side Diff: components/dom_distiller/content/distiller_page_web_contents_browsertest.cc

Issue 286583002: Pull DomDistillerOptions up to the DistillerFactory (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 | « components/dom_distiller.gypi ('k') | components/dom_distiller/core/distiller.h » ('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 18 matching lines...) Expand all
29 virtual void SetUpOnMainThread() OVERRIDE { 29 virtual void SetUpOnMainThread() OVERRIDE {
30 AddComponentsResources(); 30 AddComponentsResources();
31 SetUpTestServer(); 31 SetUpTestServer();
32 ContentBrowserTest::SetUpOnMainThread(); 32 ContentBrowserTest::SetUpOnMainThread();
33 } 33 }
34 34
35 void DistillPage(const base::Closure& quit_closure, const std::string& url) { 35 void DistillPage(const base::Closure& quit_closure, const std::string& url) {
36 quit_closure_ = quit_closure; 36 quit_closure_ = quit_closure;
37 distiller_page_->DistillPage( 37 distiller_page_->DistillPage(
38 embedded_test_server()->GetURL(url), 38 embedded_test_server()->GetURL(url),
39 dom_distiller::proto::DomDistillerOptions(),
39 base::Bind(&DistillerPageWebContentsTest::OnPageDistillationFinished, 40 base::Bind(&DistillerPageWebContentsTest::OnPageDistillationFinished,
40 this)); 41 this));
41 } 42 }
42 43
43 void OnPageDistillationFinished(scoped_ptr<DistilledPageInfo> distilled_page, 44 void OnPageDistillationFinished(scoped_ptr<DistilledPageInfo> distilled_page,
44 bool distillation_successful) { 45 bool distillation_successful) {
45 page_info_ = distilled_page.Pass(); 46 page_info_ = distilled_page.Pass();
46 quit_closure_.Run(); 47 quit_closure_.Run();
47 } 48 }
48 49
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 136
136 { 137 {
137 base::RunLoop run_loop; 138 base::RunLoop run_loop;
138 DistillPage(run_loop.QuitClosure(), "/invisible_style.html"); 139 DistillPage(run_loop.QuitClosure(), "/invisible_style.html");
139 run_loop.Run(); 140 run_loop.Run();
140 EXPECT_THAT(page_info_.get()->html, Not(HasSubstr("Lorem ipsum"))); 141 EXPECT_THAT(page_info_.get()->html, Not(HasSubstr("Lorem ipsum")));
141 } 142 }
142 } 143 }
143 144
144 } // namespace dom_distiller 145 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller.gypi ('k') | components/dom_distiller/core/distiller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698