| Index: ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java
|
| diff --git a/ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java b/ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e4476ba473fd47b9ddc3efb4cf63012da3f30f3c
|
| --- /dev/null
|
| +++ b/ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java
|
| @@ -0,0 +1,32 @@
|
| +// 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.ui.base;
|
| +
|
| +import static org.junit.Assert.assertEquals;
|
| +import static org.junit.Assert.assertTrue;
|
| +
|
| +import org.junit.Test;
|
| +import org.junit.runner.RunWith;
|
| +import org.robolectric.annotation.Config;
|
| +
|
| +import org.chromium.base.test.util.AdvancedMockContext;
|
| +import org.chromium.testing.local.LocalRobolectricTestRunner;
|
| +
|
| +/**
|
| + * Tests logic in the Clipboard class.
|
| + */
|
| +@RunWith(LocalRobolectricTestRunner.class)
|
| +@Config(manifest = Config.NONE)
|
| +public class ClipboardTest {
|
| + @Test
|
| + public void testGetClipboardContentChangeTimeInMillis() {
|
| + // Upon launch, the clipboard should be at start of epoch, i.e., ancient.
|
| + Clipboard clipboard = new Clipboard(new AdvancedMockContext());
|
| + assertEquals(0, clipboard.getClipboardContentChangeTimeInMillis());
|
| + // After updating the clipboard, it should have a new time.
|
| + clipboard.onPrimaryClipChanged();
|
| + assertTrue(clipboard.getClipboardContentChangeTimeInMillis() > 0);
|
| + }
|
| +}
|
|
|