OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.test.AndroidTestCase; | 8 import android.test.AndroidTestCase; |
9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
10 | 10 |
11 import org.chromium.base.test.util.Feature; | 11 import org.chromium.base.test.util.Feature; |
| 12 import org.chromium.ui.picker.InputDialogContainer; |
12 | 13 |
13 public class InputDialogContainerTest extends AndroidTestCase { | 14 public class InputDialogContainerTest extends AndroidTestCase { |
14 private static final int TEXT_INPUT_TYPE_DATE = 0; | 15 private static final int TEXT_INPUT_TYPE_DATE = 0; |
15 private static final int TEXT_INPUT_TYPE_DATETIME = 1; | 16 private static final int TEXT_INPUT_TYPE_DATETIME = 1; |
16 private static final int TEXT_INPUT_TYPE_DATETIMELOCAL = 2; | 17 private static final int TEXT_INPUT_TYPE_DATETIMELOCAL = 2; |
17 private static final int TEXT_INPUT_TYPE_MONTH = 3; | 18 private static final int TEXT_INPUT_TYPE_MONTH = 3; |
18 private static final int TEXT_INPUT_TYPE_TIME = 4; | 19 private static final int TEXT_INPUT_TYPE_TIME = 4; |
19 private static final int TEXT_INPUT_TYPE_WEEK = 5; | 20 private static final int TEXT_INPUT_TYPE_WEEK = 5; |
20 | 21 |
21 // Defined in third_party/WebKit/Source/platform/DateComponents.h | 22 // Defined in third_party/WebKit/Source/platform/DateComponents.h |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 mExpectedMinute = minute; | 367 mExpectedMinute = minute; |
367 mExpectedSecond = second; | 368 mExpectedSecond = second; |
368 mExpectedMillis = millis; | 369 mExpectedMillis = millis; |
369 mExpectedWeek = week; | 370 mExpectedWeek = week; |
370 mExpectedMin = min; | 371 mExpectedMin = min; |
371 mExpectedMax = max; | 372 mExpectedMax = max; |
372 mExpectedStep = step; | 373 mExpectedStep = step; |
373 } | 374 } |
374 | 375 |
375 @Override | 376 @Override |
376 void showPickerDialog(final int dialogType, | 377 protected void showPickerDialog(final int dialogType, |
377 int year, int month, int monthDay, | 378 int year, int month, int monthDay, |
378 int hourOfDay, int minute, int second, int millis, int week, | 379 int hourOfDay, int minute, int second, int millis, int week, |
379 double min, double max, double step) { | 380 double min, double max, double step) { |
380 assertEquals(mExpectedDialogType, dialogType); | 381 assertEquals(mExpectedDialogType, dialogType); |
381 assertEquals(mExpectedYear, year); | 382 assertEquals(mExpectedYear, year); |
382 assertEquals(mExpectedMonth, month); | 383 assertEquals(mExpectedMonth, month); |
383 assertEquals(mExpectedMonthDay, monthDay); | 384 assertEquals(mExpectedMonthDay, monthDay); |
384 assertEquals(mExpectedHourOfDay, hourOfDay); | 385 assertEquals(mExpectedHourOfDay, hourOfDay); |
385 assertEquals(mExpectedMinute, minute); | 386 assertEquals(mExpectedMinute, minute); |
386 assertEquals(mExpectedSecond, second); | 387 assertEquals(mExpectedSecond, second); |
387 assertEquals(mExpectedMillis, millis); | 388 assertEquals(mExpectedMillis, millis); |
388 assertEquals(mExpectedWeek, week); | 389 assertEquals(mExpectedWeek, week); |
389 assertEquals(mExpectedMin, min); | 390 assertEquals(mExpectedMin, min); |
390 assertEquals(mExpectedMax, max); | 391 assertEquals(mExpectedMax, max); |
391 assertEquals(mExpectedStep, step); | 392 assertEquals(mExpectedStep, step); |
392 } | 393 } |
393 | 394 |
394 @Override | 395 @Override |
395 public void setFieldDateTimeValue(int dialogType, | 396 public void setFieldDateTimeValue(int dialogType, |
396 int year, int month, int monthDay, | 397 int year, int month, int monthDay, |
397 int hourOfDay, int minute, int second, in
t millis, | 398 int hourOfDay, int minute, int second, in
t millis, |
398 int week) { | 399 int week) { |
399 super.setFieldDateTimeValue(dialogType, | 400 super.setFieldDateTimeValue(dialogType, |
400 year, month, monthDay, | 401 year, month, monthDay, |
401 hourOfDay, minute, second, millis, | 402 hourOfDay, minute, second, millis, |
402 week); | 403 week); |
403 } | 404 } |
404 } | 405 } |
405 } | 406 } |
OLD | NEW |