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

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: synced 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
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(viewer::GetDistilledPageFontFamilyJs(
159 DistilledPagePrefs::SERIF)),
160 0);
161 EXPECT_EQ(kMonospaceJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs(
162 DistilledPagePrefs::MONOSPACE)),
163 0);
164 EXPECT_EQ(kSansSerifJsFontFamily.compare(viewer::GetDistilledPageFontFamilyJs(
165 DistilledPagePrefs::SANS_SERIF)),
166 0);
167 }
168
154 } // namespace dom_distiller 169 } // namespace dom_distiller
OLDNEW
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698