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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java

Issue 2766373004: Convert the rest of chrome_public_test_apk InstrumentationTestCases to JUnit4 (Closed)
Patch Set: nits and rebase Created 3 years, 9 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/identity/SettingsSecureBasedIdentificationGeneratorTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java
index eef949cff74c0f214af6ca71361b5392fc0d120f..cea859b929b3cbee1516200162a26d6bd3debd62 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/identity/SettingsSecureBasedIdentificationGeneratorTest.java
@@ -5,16 +5,21 @@
package org.chromium.chrome.browser.identity;
import android.support.test.filters.SmallTest;
-import android.test.InstrumentationTestCase;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import org.chromium.base.test.util.AdvancedMockContext;
import org.chromium.base.test.util.Feature;
import org.chromium.chrome.browser.util.HashUtil;
+import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
-public class SettingsSecureBasedIdentificationGeneratorTest extends InstrumentationTestCase {
-
+@RunWith(ChromeJUnit4ClassRunner.class)
+public class SettingsSecureBasedIdentificationGeneratorTest {
private static final String FLAG_ANDROID_ID = "android_id";
+ @Test
@SmallTest
@Feature({"ChromeToMobile", "Omaha"})
public void testAndroidIdSuccessWithSalt() {
@@ -24,6 +29,7 @@ public class SettingsSecureBasedIdentificationGeneratorTest extends Instrumentat
runTest(androidId, salt, expected);
}
+ @Test
@SmallTest
@Feature({"ChromeToMobile", "Omaha"})
public void testAndroidIdSuccessWithoutSalt() {
@@ -32,6 +38,7 @@ public class SettingsSecureBasedIdentificationGeneratorTest extends Instrumentat
runTest(androidId, null, expected);
}
+ @Test
@SmallTest
@Feature({"ChromeToMobile", "Omaha"})
public void testAndroidIdFailureWithSalt() {
@@ -41,6 +48,7 @@ public class SettingsSecureBasedIdentificationGeneratorTest extends Instrumentat
runTest(androidId, salt, expected);
}
+ @Test
@SmallTest
@Feature({"ChromeToMobile", "Omaha"})
public void testAndroidIdFailureWithoutSalt() {
@@ -56,7 +64,7 @@ public class SettingsSecureBasedIdentificationGeneratorTest extends Instrumentat
// Get a unique ID and ensure it is as expected.
String result = generator.getUniqueId(salt);
- assertEquals(expectedUniqueId, result);
+ Assert.assertEquals(expectedUniqueId, result);
}
private static class TestGenerator extends SettingsSecureBasedIdentificationGenerator {

Powered by Google App Engine
This is Rietveld 408576698