OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/dom_distiller/content/dom_distiller_viewer_source.h" | 5 #include "components/dom_distiller/content/dom_distiller_viewer_source.h" |
6 | 6 |
| 7 #include <vector> |
| 8 |
7 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "components/dom_distiller/core/article_distillation_update.h" |
8 #include "components/dom_distiller/core/article_entry.h" | 11 #include "components/dom_distiller/core/article_entry.h" |
9 #include "components/dom_distiller/core/dom_distiller_service.h" | 12 #include "components/dom_distiller/core/dom_distiller_service.h" |
10 #include "components/dom_distiller/core/dom_distiller_store.h" | 13 #include "components/dom_distiller/core/dom_distiller_store.h" |
11 #include "components/dom_distiller/core/dom_distiller_test_util.h" | 14 #include "components/dom_distiller/core/dom_distiller_test_util.h" |
12 #include "components/dom_distiller/core/fake_db.h" | 15 #include "components/dom_distiller/core/fake_db.h" |
13 #include "components/dom_distiller/core/fake_distiller.h" | 16 #include "components/dom_distiller/core/fake_distiller.h" |
14 #include "components/dom_distiller/core/task_tracker.h" | 17 #include "components/dom_distiller/core/task_tracker.h" |
15 #include "components/dom_distiller/core/url_constants.h" | 18 #include "components/dom_distiller/core/url_constants.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
17 | 20 |
18 namespace dom_distiller { | 21 namespace dom_distiller { |
19 | 22 |
20 const char kTestScheme[] = "myscheme"; | 23 const char kTestScheme[] = "myscheme"; |
21 | 24 |
22 class FakeViewRequestDelegate : public ViewRequestDelegate { | 25 class FakeViewRequestDelegate : public ViewRequestDelegate { |
23 public: | 26 public: |
24 virtual ~FakeViewRequestDelegate() {} | 27 virtual ~FakeViewRequestDelegate() {} |
25 MOCK_METHOD1(OnArticleReady, void(const DistilledArticleProto* proto)); | 28 MOCK_METHOD1(OnArticleReady, void(const DistilledArticleProto* proto)); |
| 29 MOCK_METHOD1(OnArticleUpdated, |
| 30 void(ArticleDistillationUpdate article_update)); |
26 }; | 31 }; |
27 | 32 |
28 class TestDomDistillerService : public DomDistillerServiceInterface { | 33 class TestDomDistillerService : public DomDistillerServiceInterface { |
29 public: | 34 public: |
30 TestDomDistillerService() {} | 35 TestDomDistillerService() {} |
31 virtual ~TestDomDistillerService() {} | 36 virtual ~TestDomDistillerService() {} |
32 | 37 |
33 MOCK_CONST_METHOD0(GetSyncableService, syncer::SyncableService*()); | 38 MOCK_CONST_METHOD0(GetSyncableService, syncer::SyncableService*()); |
34 MOCK_METHOD2(AddToList, | 39 MOCK_METHOD2(AddToList, |
35 const std::string(const GURL&, const ArticleAvailableCallback&)); | 40 const std::string(const GURL&, const ArticleAvailableCallback&)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // Specify an internal Chrome page. | 117 // Specify an internal Chrome page. |
113 CreateViewRequest("?" + std::string(kUrlKey) + "=chrome%3A%2F%2Fsettings%2F", | 118 CreateViewRequest("?" + std::string(kUrlKey) + "=chrome%3A%2F%2Fsettings%2F", |
114 view_request_delegate.get()); | 119 view_request_delegate.get()); |
115 // Specify a recursive URL. | 120 // Specify a recursive URL. |
116 CreateViewRequest("?" + std::string(kUrlKey) + "=" + | 121 CreateViewRequest("?" + std::string(kUrlKey) + "=" + |
117 std::string(kTestScheme) + "%3A%2F%2Fabc-def%2F", | 122 std::string(kTestScheme) + "%3A%2F%2Fabc-def%2F", |
118 view_request_delegate.get()); | 123 view_request_delegate.get()); |
119 } | 124 } |
120 | 125 |
121 } // namespace dom_distiller | 126 } // namespace dom_distiller |
OLD | NEW |