Chromium Code Reviews| Index: components/dom_distiller/core/viewer_unittest.cc |
| diff --git a/components/dom_distiller/core/viewer_unittest.cc b/components/dom_distiller/core/viewer_unittest.cc |
| index 7c1b0752849aebde6b3869573a164f2c7be3936a..2806dac68c4d6d790816120507e0f2a222b5ce65 100644 |
| --- a/components/dom_distiller/core/viewer_unittest.cc |
| +++ b/components/dom_distiller/core/viewer_unittest.cc |
| @@ -4,6 +4,7 @@ |
| #include "components/dom_distiller/core/viewer.h" |
| +#include "components/dom_distiller/core/distilled_page_prefs.h" |
| #include "components/dom_distiller/core/dom_distiller_service.h" |
| #include "components/dom_distiller/core/dom_distiller_test_util.h" |
| #include "components/dom_distiller/core/task_tracker.h" |
| @@ -66,6 +67,7 @@ class TestDomDistillerService : public DomDistillerServiceInterface { |
| scoped_ptr<SourcePageHandle> handle) { |
| return scoped_ptr<DistillerPage>(); |
| } |
| + virtual DistilledPagePrefs* GetDistilledPagePrefs() OVERRIDE; |
| }; |
| class DomDistillerViewerTest : public testing::Test { |
| @@ -129,4 +131,20 @@ TEST_F(DomDistillerViewerTest, TestCreatingInvalidViewRequest) { |
| view_request_delegate.get()); |
| } |
| +DistilledPagePrefs* TestDomDistillerService::GetDistilledPagePrefs() { |
| + return NULL; |
| +} |
| + |
| +TEST_F(DomDistillerViewerTest, TestGetDistilledPageThemeJsOutput) { |
| + std::string kDarkJs = "document.body.className='dark';"; |
|
nyquist
2014/07/07 19:12:49
Nit: These needs to be updated once you call the J
smaslo
2014/07/08 19:58:11
Done.
|
| + std::string kSepiaJs = "document.body.className='sepia';"; |
| + std::string kLightJs = "document.body.className='light';"; |
| + ASSERT_EQ(kDarkJs.compare(viewer::GetDistilledPageThemeJs( |
| + DistilledPagePrefs::Theme::kDark)), 0); |
| + ASSERT_EQ(kLightJs.compare(viewer::GetDistilledPageThemeJs( |
| + DistilledPagePrefs::Theme::kLight)), 0); |
| + ASSERT_EQ(kSepiaJs.compare(viewer::GetDistilledPageThemeJs( |
| + DistilledPagePrefs::Theme::kSepia)), 0); |
| +} |
| + |
| } // namespace dom_distiller |