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/core/viewer.h" | 5 #include "components/dom_distiller/core/viewer.h" |
6 | 6 |
7 #include "components/dom_distiller/core/distilled_page_prefs.h" | 7 #include "components/dom_distiller/core/distilled_page_prefs.h" |
8 #include "components/dom_distiller/core/dom_distiller_service.h" | 8 #include "components/dom_distiller/core/dom_distiller_service.h" |
9 #include "components/dom_distiller/core/dom_distiller_test_util.h" | 9 #include "components/dom_distiller/core/dom_distiller_test_util.h" |
10 #include "components/dom_distiller/core/task_tracker.h" | 10 #include "components/dom_distiller/core/task_tracker.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 69 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( |
70 scoped_ptr<SourcePageHandle> handle) { | 70 scoped_ptr<SourcePageHandle> handle) { |
71 return scoped_ptr<DistillerPage>(); | 71 return scoped_ptr<DistillerPage>(); |
72 } | 72 } |
73 virtual DistilledPagePrefs* GetDistilledPagePrefs() override; | 73 virtual DistilledPagePrefs* GetDistilledPagePrefs() override; |
74 }; | 74 }; |
75 | 75 |
76 class DomDistillerViewerTest : public testing::Test { | 76 class DomDistillerViewerTest : public testing::Test { |
77 public: | 77 public: |
78 virtual void SetUp() override { | 78 void SetUp() override { service_.reset(new TestDomDistillerService()); } |
79 service_.reset(new TestDomDistillerService()); | |
80 } | |
81 | 79 |
82 protected: | 80 protected: |
83 scoped_ptr<ViewerHandle> CreateViewRequest( | 81 scoped_ptr<ViewerHandle> CreateViewRequest( |
84 const std::string& path, | 82 const std::string& path, |
85 ViewRequestDelegate* view_request_delegate) { | 83 ViewRequestDelegate* view_request_delegate) { |
86 return viewer::CreateViewRequest( | 84 return viewer::CreateViewRequest( |
87 service_.get(), path, view_request_delegate, gfx::Size()); | 85 service_.get(), path, view_request_delegate, gfx::Size()); |
88 } | 86 } |
89 | 87 |
90 scoped_ptr<TestDomDistillerService> service_; | 88 scoped_ptr<TestDomDistillerService> service_; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 0); | 160 0); |
163 EXPECT_EQ(kMonospaceJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs( | 161 EXPECT_EQ(kMonospaceJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs( |
164 DistilledPagePrefs::MONOSPACE)), | 162 DistilledPagePrefs::MONOSPACE)), |
165 0); | 163 0); |
166 EXPECT_EQ(kSansSerifJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs( | 164 EXPECT_EQ(kSansSerifJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs( |
167 DistilledPagePrefs::SANS_SERIF)), | 165 DistilledPagePrefs::SANS_SERIF)), |
168 0); | 166 0); |
169 } | 167 } |
170 | 168 |
171 } // namespace dom_distiller | 169 } // namespace dom_distiller |
OLD | NEW |