| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 class MockDistillerURLFetcherFactory : public DistillerURLFetcherFactory { | 256 class MockDistillerURLFetcherFactory : public DistillerURLFetcherFactory { |
| 257 public: | 257 public: |
| 258 MockDistillerURLFetcherFactory() : DistillerURLFetcherFactory(NULL) {} | 258 MockDistillerURLFetcherFactory() : DistillerURLFetcherFactory(NULL) {} |
| 259 virtual ~MockDistillerURLFetcherFactory() {} | 259 virtual ~MockDistillerURLFetcherFactory() {} |
| 260 | 260 |
| 261 MOCK_CONST_METHOD0(CreateDistillerURLFetcher, DistillerURLFetcher*()); | 261 MOCK_CONST_METHOD0(CreateDistillerURLFetcher, DistillerURLFetcher*()); |
| 262 }; | 262 }; |
| 263 | 263 |
| 264 class DistillerTest : public testing::Test { | 264 class DistillerTest : public testing::Test { |
| 265 public: | 265 public: |
| 266 virtual ~DistillerTest() {} | 266 ~DistillerTest() override {} |
| 267 | 267 |
| 268 void OnDistillArticleDone(scoped_ptr<DistilledArticleProto> proto) { | 268 void OnDistillArticleDone(scoped_ptr<DistilledArticleProto> proto) { |
| 269 article_proto_ = proto.Pass(); | 269 article_proto_ = proto.Pass(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void OnDistillArticleUpdate(const ArticleDistillationUpdate& article_update) { | 272 void OnDistillArticleUpdate(const ArticleDistillationUpdate& article_update) { |
| 273 in_sequence_updates_.push_back(article_update); | 273 in_sequence_updates_.push_back(article_update); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void DistillPage(const std::string& url, | 276 void DistillPage(const std::string& url, |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 645 |
| 646 ASSERT_TRUE(distiller_page); | 646 ASSERT_TRUE(distiller_page); |
| 647 // Post the task to execute javascript and then delete the distiller. | 647 // Post the task to execute javascript and then delete the distiller. |
| 648 distiller_page->OnDistillationDone(GURL(kURL), distilled_value.get()); | 648 distiller_page->OnDistillationDone(GURL(kURL), distilled_value.get()); |
| 649 distiller_.reset(); | 649 distiller_.reset(); |
| 650 | 650 |
| 651 base::MessageLoop::current()->RunUntilIdle(); | 651 base::MessageLoop::current()->RunUntilIdle(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace dom_distiller | 654 } // namespace dom_distiller |
| OLD | NEW |