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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/blimp/BlimpPreferencesTest.java

Issue 2173563003: Blimp settings UI integration for Chrome, everything still lives in Blimp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add v7 support jar in Blimp build.gn, to make trybot happy. Created 4 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/blimp/BlimpPreferencesTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/blimp/BlimpPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/blimp/BlimpPreferencesTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e930d681089d0d8827dee4e6412777ac7f6560b4
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/blimp/BlimpPreferencesTest.java
@@ -0,0 +1,56 @@
+// Copyright 2016 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.blimp;
+
+import android.preference.Preference;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.test.util.Feature;
+import org.chromium.blimp_public.BlimpClientContext;
+import org.chromium.chrome.browser.preferences.MainPreferences;
+import org.chromium.chrome.browser.preferences.Preferences;
+import org.chromium.chrome.browser.preferences.PreferencesTest;
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.chrome.test.ChromeTabbedActivityTestBase;
+
+/**
+ * Test blimp settings preferences.
+ */
+public class BlimpPreferencesTest extends ChromeTabbedActivityTestBase {
David Trainor- moved to gerrit 2016/07/22 16:51:43 Can we just test that the fragment loads and that
xingliu 2016/07/23 23:50:36 Done. Moved the test code to blimp also.
+ public static final String PREF_BLIMP_SWITCH = "blimp_switch";
David Trainor- moved to gerrit 2016/07/22 16:51:43 private?
xingliu 2016/07/23 23:50:36 Done. Removed this and use const string in another
+
+ @SmallTest
+ @Feature({"Blimp"})
+ public void testBlimpPreference() {
+ // Start Chrome preferences.
+ final Preferences prefActivity = PreferencesTest.startPreferences(getInstrumentation(),
+ MainPreferences.class.getName());
+
+ final MainPreferences mainPreferences = (MainPreferences) prefActivity.getFragmentForTest();
+
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ // Check if blimp settings preference is attached correctly.
+ Preference pref = mainPreferences.findPreference(PREF_BLIMP_SWITCH);
+ BlimpClientContext blimpClientContext = BlimpClientContextFactory
+ .getBlimpClientContextForProfile(
+ Profile.getLastUsedProfile().getOriginalProfile());
+ if (blimpClientContext.isBlimpSupported()) {
+ assertNotNull(pref);
+ } else {
+ assertNull(pref);
+ }
+ }
+ });
+ prefActivity.finish();
+ }
+
+ @Override
+ public void startMainActivity() throws InterruptedException {
+ startMainActivityOnBlankPage();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698