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

Side by Side Diff: chrome/browser/dom_distiller/distillable_page_utils_browsertest.cc

Issue 2361643004: Control distillability with command-line flag (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <string.h> 5 #include <string.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 } // namespace 90 } // namespace
91 91
92 template<const char Option[]> 92 template<const char Option[]>
93 class DistillablePageUtilsBrowserTestOption : public InProcessBrowserTest { 93 class DistillablePageUtilsBrowserTestOption : public InProcessBrowserTest {
94 public: 94 public:
95 void SetUpCommandLine(base::CommandLine* command_line) override { 95 void SetUpCommandLine(base::CommandLine* command_line) override {
96 command_line->AppendSwitch(switches::kEnableDomDistiller); 96 command_line->AppendSwitch(switches::kEnableDomDistiller);
97 command_line->AppendSwitchASCII(switches::kReaderModeHeuristics, 97 command_line->AppendSwitchASCII(switches::kReaderModeHeuristics,
98 Option); 98 Option);
99 command_line->AppendSwitch(switches::kEnableDistillabilityService);
99 } 100 }
100 101
101 void SetUpOnMainThread() override { 102 void SetUpOnMainThread() override {
102 InProcessBrowserTest::SetUpOnMainThread(); 103 InProcessBrowserTest::SetUpOnMainThread();
103 ASSERT_TRUE(embedded_test_server()->Start()); 104 ASSERT_TRUE(embedded_test_server()->Start());
104 web_contents_ = 105 web_contents_ =
105 browser()->tab_strip_model()->GetActiveWebContents(); 106 browser()->tab_strip_model()->GetActiveWebContents();
106 setDelegate(web_contents_, holder_.GetDelegate()); 107 setDelegate(web_contents_, holder_.GetDelegate());
107 } 108 }
108 109
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 { 196 {
196 testing::InSequence dummy; 197 testing::InSequence dummy;
197 EXPECT_CALL(holder_, OnResult(false, false)).Times(1); 198 EXPECT_CALL(holder_, OnResult(false, false)).Times(1);
198 EXPECT_CALL(holder_, OnResult(false, true)) 199 EXPECT_CALL(holder_, OnResult(false, true))
199 .WillOnce(testing::InvokeWithoutArgs(QuitSoon)); 200 .WillOnce(testing::InvokeWithoutArgs(QuitSoon));
200 NavigateAndWait(kNonArticlePath, 0); 201 NavigateAndWait(kNonArticlePath, 0);
201 } 202 }
202 } 203 }
203 204
204 } // namespace dom_distiller 205 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698