| OLD | NEW |
| 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/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 class DistillablePageUtilsBrowserTestOption : public InProcessBrowserTest { | 94 class DistillablePageUtilsBrowserTestOption : public InProcessBrowserTest { |
| 95 public: | 95 public: |
| 96 void SetUpCommandLine(base::CommandLine* command_line) override { | 96 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 97 command_line->AppendSwitch(switches::kEnableDomDistiller); | 97 command_line->AppendSwitch(switches::kEnableDomDistiller); |
| 98 command_line->AppendSwitchASCII(switches::kReaderModeHeuristics, | 98 command_line->AppendSwitchASCII(switches::kReaderModeHeuristics, |
| 99 Option); | 99 Option); |
| 100 command_line->AppendSwitch(switches::kEnableDistillabilityService); | 100 command_line->AppendSwitch(switches::kEnableDistillabilityService); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void SetUpOnMainThread() override { | 103 void SetUpOnMainThread() override { |
| 104 InProcessBrowserTest::SetUpOnMainThread(); | |
| 105 ASSERT_TRUE(embedded_test_server()->Start()); | 104 ASSERT_TRUE(embedded_test_server()->Start()); |
| 106 web_contents_ = | 105 web_contents_ = |
| 107 browser()->tab_strip_model()->GetActiveWebContents(); | 106 browser()->tab_strip_model()->GetActiveWebContents(); |
| 108 setDelegate(web_contents_, holder_.GetDelegate()); | 107 setDelegate(web_contents_, holder_.GetDelegate()); |
| 109 } | 108 } |
| 110 | 109 |
| 111 void NavigateAndWait(const char* url, int timeout_ms) { | 110 void NavigateAndWait(const char* url, int timeout_ms) { |
| 112 GURL article_url(url); | 111 GURL article_url(url); |
| 113 if (base::StartsWith(url, "/", base::CompareCase::SENSITIVE)) { | 112 if (base::StartsWith(url, "/", base::CompareCase::SENSITIVE)) { |
| 114 article_url = embedded_test_server()->GetURL(url); | 113 article_url = embedded_test_server()->GetURL(url); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 { | 196 { |
| 198 testing::InSequence dummy; | 197 testing::InSequence dummy; |
| 199 EXPECT_CALL(holder_, OnResult(false, false)).Times(1); | 198 EXPECT_CALL(holder_, OnResult(false, false)).Times(1); |
| 200 EXPECT_CALL(holder_, OnResult(false, true)) | 199 EXPECT_CALL(holder_, OnResult(false, true)) |
| 201 .WillOnce(testing::InvokeWithoutArgs(QuitSoon)); | 200 .WillOnce(testing::InvokeWithoutArgs(QuitSoon)); |
| 202 NavigateAndWait(kNonArticlePath, 0); | 201 NavigateAndWait(kNonArticlePath, 0); |
| 203 } | 202 } |
| 204 } | 203 } |
| 205 | 204 |
| 206 } // namespace dom_distiller | 205 } // namespace dom_distiller |
| OLD | NEW |