fake_distiller_page.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_PAGE_H_
  5. #define COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_PAGE_H_
  6. #include "components/dom_distiller/core/distiller_page.h"
  7. #include "testing/gmock/include/gmock/gmock.h"
  8. namespace dom_distiller {
  9. namespace test {
  10. class MockDistillerPageFactory : public DistillerPageFactory {
  11. public:
  12. MockDistillerPageFactory();
  13. ~MockDistillerPageFactory() override;
  14. MOCK_CONST_METHOD0(CreateDistillerPageImpl, DistillerPage*());
  15. std::unique_ptr<DistillerPage> CreateDistillerPage(
  16. const gfx::Size& render_view_size) const override {
  17. return std::unique_ptr<DistillerPage>(CreateDistillerPageImpl());
  18. }
  19. std::unique_ptr<DistillerPage> CreateDistillerPageWithHandle(
  20. std::unique_ptr<SourcePageHandle> handle) const override {
  21. return std::unique_ptr<DistillerPage>(CreateDistillerPageImpl());
  22. }
  23. };
  24. class MockDistillerPage : public DistillerPage {
  25. public:
  26. MockDistillerPage();
  27. ~MockDistillerPage() override;
  28. bool StringifyOutput() override { return false; }
  29. MOCK_METHOD2(DistillPageImpl,
  30. void(const GURL& gurl, const std::string& script));
  31. };
  32. } // namespace test
  33. } // namespace dom_distiller
  34. #endif // COMPONENTS_DOM_DISTILLER_CORE_FAKE_DISTILLER_PAGE_H_