Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java |
index cc876634f8bf130d6c03d55eb5000e80048ef9ec..ae1f7bcf3a0a49d5ca5db39865c86b23e11f2c42 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenBackgroundColorTest.java |
@@ -10,35 +10,51 @@ import android.graphics.drawable.ColorDrawable; |
import android.support.test.filters.SmallTest; |
import android.view.ViewGroup; |
+import org.junit.Assert; |
+import org.junit.Rule; |
+import org.junit.Test; |
+import org.junit.runner.RunWith; |
+ |
import org.chromium.base.metrics.RecordHistogram; |
+import org.chromium.base.test.util.CommandLineFlags; |
import org.chromium.base.test.util.Feature; |
+import org.chromium.chrome.browser.ChromeSwitches; |
import org.chromium.chrome.browser.ShortcutHelper; |
import org.chromium.chrome.browser.metrics.WebappUma; |
+import org.chromium.chrome.test.ChromeActivityTestRule; |
+import org.chromium.chrome.test.ChromeJUnit4ClassRunner; |
/** |
* Tests for splash screens with EXTRA_BACKGROND_COLOR specified in the Intent. |
*/ |
-public class WebappSplashScreenBackgroundColorTest extends WebappActivityTestBase { |
- @Override |
- protected Intent createIntent() { |
- Intent intent = super.createIntent(); |
+@RunWith(ChromeJUnit4ClassRunner.class) |
+@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, |
+ ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG}) |
+public class WebappSplashScreenBackgroundColorTest { |
+ @Rule |
+ public final WebappActivityTestRule mActivityTestRule = new WebappActivityTestRule(); |
+ |
+ private Intent createIntent() { |
+ Intent intent = mActivityTestRule.createIntent(); |
// This is setting Color.GREEN with 50% opacity. |
intent.putExtra(ShortcutHelper.EXTRA_BACKGROUND_COLOR, 0x8000FF00L); |
return intent; |
} |
+ @Test |
@SmallTest |
@Feature({"Webapps"}) |
public void testShowBackgroundColorAndRecordUma() throws Exception { |
- startWebappActivity(); |
+ mActivityTestRule.startWebappActivity(createIntent()); |
- ViewGroup splashScreen = waitUntilSplashScreenAppears(); |
+ ViewGroup splashScreen = mActivityTestRule.waitUntilSplashScreenAppears(); |
ColorDrawable background = (ColorDrawable) splashScreen.getBackground(); |
- assertEquals(Color.GREEN, background.getColor()); |
+ Assert.assertEquals(Color.GREEN, background.getColor()); |
- assertEquals(1, RecordHistogram.getHistogramValueCountForTesting( |
- WebappUma.HISTOGRAM_SPLASHSCREEN_BACKGROUNDCOLOR, |
- WebappUma.SPLASHSCREEN_COLOR_STATUS_CUSTOM)); |
+ Assert.assertEquals(1, |
+ RecordHistogram.getHistogramValueCountForTesting( |
+ WebappUma.HISTOGRAM_SPLASHSCREEN_BACKGROUNDCOLOR, |
+ WebappUma.SPLASHSCREEN_COLOR_STATUS_CUSTOM)); |
} |
} |