OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.ui.base; |
| 6 |
| 7 import static org.junit.Assert.assertEquals; |
| 8 import static org.junit.Assert.assertTrue; |
| 9 |
| 10 import org.junit.Test; |
| 11 import org.junit.runner.RunWith; |
| 12 import org.robolectric.annotation.Config; |
| 13 |
| 14 import org.chromium.base.test.util.AdvancedMockContext; |
| 15 import org.chromium.testing.local.LocalRobolectricTestRunner; |
| 16 |
| 17 /** |
| 18 * Tests logic in the Clipboard class. |
| 19 */ |
| 20 @RunWith(LocalRobolectricTestRunner.class) |
| 21 @Config(manifest = Config.NONE) |
| 22 public class ClipboardTest { |
| 23 @Test |
| 24 public void testGetClipboardContentChangeTimeInMillis() { |
| 25 // Upon launch, the clipboard should be at start of epoch, i.e., ancient
. |
| 26 Clipboard clipboard = new Clipboard(new AdvancedMockContext()); |
| 27 assertEquals(0, clipboard.getClipboardContentChangeTimeInMillis()); |
| 28 // After updating the clipboard, it should have a new time. |
| 29 clipboard.onPrimaryClipChanged(); |
| 30 assertTrue(clipboard.getClipboardContentChangeTimeInMillis() > 0); |
| 31 } |
| 32 } |
OLD | NEW |