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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
6 #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_
8 #include "components/dom_distiller/core/article_entry.h"
9 #include "components/dom_distiller/core/distiller.h"
10 #include "testing/gmock/include/gmock/gmock.h"
15 namespace dom_distiller {
18 class MockDistillerFactory : public DistillerFactory {
20 MockDistillerFactory();
21 virtual ~MockDistillerFactory();
22 MOCK_METHOD0(CreateDistillerImpl, Distiller*());
23 virtual scoped_ptr<Distiller> CreateDistiller() OVERRIDE {
24 return scoped_ptr<Distiller>(CreateDistillerImpl());
28 class FakeDistiller : public Distiller {
30 explicit FakeDistiller(bool execute_callback);
31 virtual ~FakeDistiller();
32 MOCK_METHOD0(Die, void());
34 virtual void DistillPage(const GURL& url,
35 const DistillerCallback& callback) OVERRIDE;
37 void RunDistillerCallback(scoped_ptr<DistilledArticleProto> proto);
39 GURL GetUrl() { return url_; }
41 DistillerCallback GetCallback() { return callback_; }
44 void RunDistillerCallbackInternal(scoped_ptr<DistilledArticleProto> proto);
46 bool execute_callback_;
48 DistillerCallback callback_;
52 } // namespace dom_distiller
54 #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_H_