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

Unified Diff: components/dom_distiller/core/viewer_unittest.cc

Issue 341563002: Theme Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments from Patch 15 Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
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..422194f2e471084965c346b791b8178d1b5b2099 100644
--- a/components/dom_distiller/core/viewer_unittest.cc
+++ b/components/dom_distiller/core/viewer_unittest.cc
@@ -6,6 +6,7 @@
#include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/dom_distiller/core/dom_distiller_test_util.h"
+#include "components/dom_distiller/core/reader_mode_preferences.h"
#include "components/dom_distiller/core/task_tracker.h"
#include "components/dom_distiller/core/url_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -66,6 +67,7 @@ class TestDomDistillerService : public DomDistillerServiceInterface {
scoped_ptr<SourcePageHandle> handle) {
return scoped_ptr<DistillerPage>();
}
+ virtual ReaderModePrefs* GetReaderModePrefs() OVERRIDE;
};
class DomDistillerViewerTest : public testing::Test {
@@ -129,4 +131,20 @@ TEST_F(DomDistillerViewerTest, TestCreatingInvalidViewRequest) {
view_request_delegate.get());
}
+ReaderModePrefs* TestDomDistillerService::GetReaderModePrefs() {
+ return NULL;
+}
+
+TEST_F(DomDistillerViewerTest, TestGetBodyCssClassOutput) {
+ std::string kDark = "dark";
+ std::string kSepia = "sepia";
+ std::string kLight = "light";
+ ASSERT_EQ(kDark.compare(viewer::GetBodyCssClass(
+ ReaderModePrefs::Theme::kDark)), 0);
+ ASSERT_EQ(kLight.compare(viewer::GetBodyCssClass(
+ ReaderModePrefs::Theme::kLight)), 0);
+ ASSERT_EQ(kSepia.compare(viewer::GetBodyCssClass(
+ ReaderModePrefs::Theme::kSepia)), 0);
+}
+
} // namespace dom_distiller
« components/dom_distiller/core/viewer.cc ('K') | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698