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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java

Issue 2708243004: Auto convert content shell tests to JUnit4 (Closed)
Patch Set: New test added from WebContentsTest 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: content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java b/content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java
index 7c769ba81c0d26d1e9df91d93a93707ba491b911..f160d73a21b7532eda6bc2ba3cfc537e43c75307 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java
@@ -1,23 +1,32 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2017 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.content.browser.picker;
+import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
-import android.test.InstrumentationTestCase;
import android.widget.TimePicker;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+
/**
* Tests for DateTimePickerDialog.
*/
-public class DateTimePickerDialogTest extends InstrumentationTestCase {
+@RunWith(BaseJUnit4ClassRunner.class)
+public class DateTimePickerDialogTest {
//TODO(tkent): fix deprecation warnings crbug.com/537037
+ @Test
@SuppressWarnings("deprecation")
@SmallTest
public void testOnTimeChanged() {
int september = 8;
- TimePicker picker = new TimePicker(getInstrumentation().getContext());
+ TimePicker picker =
+ new TimePicker(InstrumentationRegistry.getInstrumentation().getContext());
// 2015-09-16 00:00 UTC
long min = 1442361600000L;
// 2015-09-17 00:00 UTC
@@ -27,15 +36,15 @@ public class DateTimePickerDialogTest extends InstrumentationTestCase {
picker.setCurrentHour(1);
picker.setCurrentMinute(30);
DateTimePickerDialog.onTimeChangedInternal(2015, september, 16, picker, min, max);
- assertEquals(1, picker.getCurrentHour().intValue());
- assertEquals(30, picker.getCurrentMinute().intValue());
+ Assert.assertEquals(1, picker.getCurrentHour().intValue());
+ Assert.assertEquals(30, picker.getCurrentMinute().intValue());
// Test a value near to the maximum.
picker.setCurrentHour(22);
picker.setCurrentMinute(56);
DateTimePickerDialog.onTimeChangedInternal(2015, september, 16, picker, min, max);
- assertEquals(22, picker.getCurrentHour().intValue());
- assertEquals(56, picker.getCurrentMinute().intValue());
+ Assert.assertEquals(22, picker.getCurrentHour().intValue());
+ Assert.assertEquals(56, picker.getCurrentMinute().intValue());
// Clamping.
picker.setCurrentHour(23);
@@ -43,7 +52,7 @@ public class DateTimePickerDialogTest extends InstrumentationTestCase {
// 2015-09-16 23:30 UTC
max = 1442446200000L;
DateTimePickerDialog.onTimeChangedInternal(2015, september, 16, picker, min, max);
- assertEquals(23, picker.getCurrentHour().intValue());
- assertEquals(30, picker.getCurrentMinute().intValue());
+ Assert.assertEquals(23, picker.getCurrentHour().intValue());
+ Assert.assertEquals(30, picker.getCurrentMinute().intValue());
}
}

Powered by Google App Engine
This is Rietveld 408576698