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

Side by Side Diff: components/dom_distiller/core/fake_distiller.h

Issue 178303004: Add incremental updates for multipage distillation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile by adding a header. Created 6 years, 9 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
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 #ifndef COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 6 #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
7 7
8 #include "components/dom_distiller/core/article_distillation_update.h"
8 #include "components/dom_distiller/core/article_entry.h" 9 #include "components/dom_distiller/core/article_entry.h"
9 #include "components/dom_distiller/core/distiller.h" 10 #include "components/dom_distiller/core/distiller.h"
10 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
11 #include "url/gurl.h" 12 #include "url/gurl.h"
12 13
13 class GURL; 14 class GURL;
14 15
15 namespace dom_distiller { 16 namespace dom_distiller {
16 namespace test { 17 namespace test {
17 18
18 class MockDistillerFactory : public DistillerFactory { 19 class MockDistillerFactory : public DistillerFactory {
19 public: 20 public:
20 MockDistillerFactory(); 21 MockDistillerFactory();
21 virtual ~MockDistillerFactory(); 22 virtual ~MockDistillerFactory();
22 MOCK_METHOD0(CreateDistillerImpl, Distiller*()); 23 MOCK_METHOD0(CreateDistillerImpl, Distiller*());
23 virtual scoped_ptr<Distiller> CreateDistiller() OVERRIDE { 24 virtual scoped_ptr<Distiller> CreateDistiller() OVERRIDE {
24 return scoped_ptr<Distiller>(CreateDistillerImpl()); 25 return scoped_ptr<Distiller>(CreateDistillerImpl());
25 } 26 }
26 }; 27 };
27 28
28 class FakeDistiller : public Distiller { 29 class FakeDistiller : public Distiller {
29 public: 30 public:
30 explicit FakeDistiller(bool execute_callback); 31 explicit FakeDistiller(bool execute_callback);
31 virtual ~FakeDistiller(); 32 virtual ~FakeDistiller();
32 MOCK_METHOD0(Die, void()); 33 MOCK_METHOD0(Die, void());
33 34
34 virtual void DistillPage(const GURL& url, 35 virtual void DistillPage(const GURL& url,
35 const DistillerCallback& callback) OVERRIDE; 36 const ArticleDistillationCallback& article_callback,
37 const PageDistillationCallback& page_callback)
38 OVERRIDE;
36 39
37 void RunDistillerCallback(scoped_ptr<DistilledArticleProto> proto); 40 void RunDistillerCallback(scoped_ptr<DistilledArticleProto> proto);
38 41
39 GURL GetUrl() { return url_; } 42 GURL GetUrl() { return url_; }
40 43
41 DistillerCallback GetCallback() { return callback_; } 44 ArticleDistillationCallback GetArticleCallback() { return article_callback_; }
42 45
43 private: 46 private:
44 void RunDistillerCallbackInternal(scoped_ptr<DistilledArticleProto> proto); 47 void RunDistillerCallbackInternal(scoped_ptr<DistilledArticleProto> proto);
45 48
46 bool execute_callback_; 49 bool execute_callback_;
47 GURL url_; 50 GURL url_;
48 DistillerCallback callback_; 51 ArticleDistillationCallback article_callback_;
52 PageDistillationCallback page_callback_;
49 }; 53 };
50 54
51 } // namespace test 55 } // namespace test
52 } // namespace dom_distiller 56 } // namespace dom_distiller
53 57
54 #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_ 58 #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698