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

Side by Side Diff: ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java

Issue 2766623003: Make Android Clipboard Keep Track of Last Modified Time (Closed)
Patch Set: ted's comments 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 unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698