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

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: modified DEPS for test dependencies 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
« no previous file with comments | « chrome/android/javatests/DEPS ('k') | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..60e87b154f6646cd6d780cdbaf3964edb601ef90
--- /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);
+ // Check that theme can be correctly set.
+ distilledPagePrefs.setTheme(Theme.DARK);
+ assertEquals(Theme.DARK, distilledPagePrefs.getTheme());
+ distilledPagePrefs.setTheme(Theme.LIGHT);
+ assertEquals(Theme.LIGHT, distilledPagePrefs.getTheme());
+ distilledPagePrefs.setTheme(Theme.SEPIA);
+ assertEquals(Theme.SEPIA, distilledPagePrefs.getTheme());
+ }
+}
« no previous file with comments | « chrome/android/javatests/DEPS ('k') | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698