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

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: Minor change - dependency order Created 6 years, 5 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..20fd27d9b4f4621541589c9d09bfac5c5c097715 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,23 @@ TEST_F(DomDistillerViewerTest, TestCreatingInvalidViewRequest) {
view_request_delegate.get());
}
+DistilledPagePrefs* TestDomDistillerService::GetDistilledPagePrefs() {
+ return NULL;
+}
+
+TEST_F(DomDistillerViewerTest, TestGetDistilledPageThemeJsOutput) {
+ std::string kDarkJs = "useTheme('dark');";
+ std::string kSepiaJs = "useTheme('sepia');";
+ std::string kLightJs = "useTheme('light');";
+ EXPECT_EQ(kDarkJs.compare(viewer::GetDistilledPageThemeJs(
+ DistilledPagePrefs::DARK)),
+ 0);
+ EXPECT_EQ(kLightJs.compare(viewer::GetDistilledPageThemeJs(
+ DistilledPagePrefs::LIGHT)),
+ 0);
+ EXPECT_EQ(kSepiaJs.compare(viewer::GetDistilledPageThemeJs(
+ DistilledPagePrefs::SEPIA)),
+ 0);
+}
+
} // namespace dom_distiller

Powered by Google App Engine
This is Rietveld 408576698