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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java

Issue 340403004: Java wrapper for DistilledPagePrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stylistic changes, rename ThemeTestPref, remove unnecessary files 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: chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..2a25c65472ba47a681209d09f0880ee8b2f4d794
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/dom_distiller/DistilledPagePrefsTest.java
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.dom_distiller;
+
+import android.test.suitebuilder.annotation.SmallTest;
+import android.test.UiThreadTest;
+
+import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.chrome.shell.ChromeShellTestBase;
+import org.chromium.components.dom_distiller.core.DistilledPagePrefs;
+import org.chromium.components.dom_distiller.core.DomDistillerService;
+import org.chromium.components.dom_distiller.core.Theme;
+
+/**
+ * Test class for {@link DistilledPagePrefs}.
+ */
+public class DistilledPagePrefsTest extends ChromeShellTestBase {
+
+ @SmallTest
+ @UiThreadTest
+ @Feature({"DomDistiller"})
+ public void testGetAndSetPrefs() throws InterruptedException {
+ startChromeBrowserProcessSync(getInstrumentation().getTargetContext());
+ DomDistillerService service = DomDistillerServiceFactory.
+ getForProfile(Profile.getLastUsedProfile());
+ assertNotNull(service);
+ DistilledPagePrefs distilledPagePrefs = service.getDistilledPagePrefs();
+ assertNotNull(distilledPagePrefs);
+ // Check default theme.
+ assertEquals(distilledPagePrefs.getTheme(), Theme.LIGHT);
nyquist 2014/07/10 15:59:58 (Expected, Actual) across these asserts
sunangel 2014/07/10 20:19:55 Done.
+ // Check that theme can be correctly set.
+ distilledPagePrefs.setTheme(Theme.DARK);
+ assertEquals(distilledPagePrefs.getTheme(), Theme.DARK);
+ distilledPagePrefs.setTheme(Theme.LIGHT);
+ assertEquals(distilledPagePrefs.getTheme(), Theme.LIGHT);
+ distilledPagePrefs.setTheme(Theme.SEPIA);
+ assertEquals(distilledPagePrefs.getTheme(), Theme.SEPIA);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698