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

Side by Side Diff: components/dom_distiller/core/viewer_unittest.cc

Issue 430473007: Font Family Preferences for Distilled Pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: styling Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 DistilledPagePrefs::DARK)), 144 DistilledPagePrefs::DARK)),
145 0); 145 0);
146 EXPECT_EQ(kLightJs.compare(viewer::GetDistilledPageThemeJs( 146 EXPECT_EQ(kLightJs.compare(viewer::GetDistilledPageThemeJs(
147 DistilledPagePrefs::LIGHT)), 147 DistilledPagePrefs::LIGHT)),
148 0); 148 0);
149 EXPECT_EQ(kSepiaJs.compare(viewer::GetDistilledPageThemeJs( 149 EXPECT_EQ(kSepiaJs.compare(viewer::GetDistilledPageThemeJs(
150 DistilledPagePrefs::SEPIA)), 150 DistilledPagePrefs::SEPIA)),
151 0); 151 0);
152 } 152 }
153 153
154 TEST_F(DomDistillerViewerTest, TestGetDistilledPageFontFamilyJsOutput) {
155 std::string kSerifJsFontFamily = "useFontFamily('serif');";
156 std::string kMonospaceJsFontFamily = "useFontFamily('monospace');";
157 std::string kSansSerifJsFontFamily = "useFontFamily('sans-serif');";
158 EXPECT_EQ(kSerifJsFontFamily.compare(
159 viewer::GetDistilledPageFontFamilyJs(DistilledPagePrefs::SERIF)), 0);
160 EXPECT_EQ(kMonospaceJsFontFamily.compare(
161 viewer::GetDistilledPageFontFamilyJs(DistilledPagePrefs::MONOSPACE)), 0);
162 EXPECT_EQ(kSansSerifJsFontFamily.compare(
163 viewer::GetDistilledPageFontFamilyJs(DistilledPagePrefs::SANS_SERIF)), 0);
164 }
165
154 } // namespace dom_distiller 166 } // namespace dom_distiller
OLDNEW
« components/dom_distiller/core/font_family_list.h ('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