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

Side by Side Diff: chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java

Issue 2081153005: [Offline Page] Offline page sharing implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge CL Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.chrome.browser.offlinepages; 5 package org.chromium.chrome.browser.offlinepages;
6 6
7 import static org.junit.Assert.assertEquals; 7 import static org.junit.Assert.assertEquals;
8 import static org.junit.Assert.assertNotNull; 8 import static org.junit.Assert.assertNotNull;
9 import static org.junit.Assert.assertTrue; 9 import static org.junit.Assert.assertTrue;
10 import static org.mockito.Matchers.anyListOf; 10 import static org.mockito.Matchers.anyListOf;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 shadows = {ShadowMultiDex.class}) 45 shadows = {ShadowMultiDex.class})
46 public class OfflinePageBridgeTest { 46 public class OfflinePageBridgeTest {
47 private OfflinePageBridge mBridge; 47 private OfflinePageBridge mBridge;
48 48
49 private static final String TEST_NAMESPACE = "TEST_NAMESPACE"; 49 private static final String TEST_NAMESPACE = "TEST_NAMESPACE";
50 private static final String TEST_ID = "TEST_ID"; 50 private static final String TEST_ID = "TEST_ID";
51 private static final String TEST_URL = "TEST_URL"; 51 private static final String TEST_URL = "TEST_URL";
52 private static final long TEST_OFFLINE_ID = 42; 52 private static final long TEST_OFFLINE_ID = 42;
53 private static final ClientId TEST_CLIENT_ID = new ClientId(TEST_NAMESPACE, TEST_ID); 53 private static final ClientId TEST_CLIENT_ID = new ClientId(TEST_NAMESPACE, TEST_ID);
54 private static final String TEST_OFFLINE_URL = "TEST_OFFLINE_URL"; 54 private static final String TEST_OFFLINE_URL = "TEST_OFFLINE_URL";
55 private static final String TEST_FILE_PATH = "TEST_FILE_PATH";
55 private static final long TEST_FILESIZE = 12345; 56 private static final long TEST_FILESIZE = 12345;
56 private static final long TEST_CREATIONTIMEMS = 150; 57 private static final long TEST_CREATIONTIMEMS = 150;
57 private static final int TEST_ACCESSCOUNT = 1; 58 private static final int TEST_ACCESSCOUNT = 1;
58 private static final long TEST_LASTACCESSTIMEMS = 20160314; 59 private static final long TEST_LASTACCESSTIMEMS = 20160314;
59 60
60 private static final OfflinePageItem TEST_OFFLINE_PAGE_ITEM = new OfflinePag eItem(TEST_URL, 61 private static final OfflinePageItem TEST_OFFLINE_PAGE_ITEM = new OfflinePag eItem(TEST_URL,
61 TEST_OFFLINE_ID, TEST_NAMESPACE, TEST_ID, TEST_OFFLINE_URL, TEST_FIL ESIZE, 62 TEST_OFFLINE_ID, TEST_NAMESPACE, TEST_ID, TEST_OFFLINE_URL, TEST_FIL E_PATH,
62 TEST_CREATIONTIMEMS, TEST_ACCESSCOUNT, TEST_LASTACCESSTIMEMS); 63 TEST_FILESIZE, TEST_CREATIONTIMEMS, TEST_ACCESSCOUNT, TEST_LASTACCES STIMEMS);
63 64
64 @Captor 65 @Captor
65 ArgumentCaptor<List<OfflinePageItem>> mResultArgument; 66 ArgumentCaptor<List<OfflinePageItem>> mResultArgument;
66 67
67 @Captor 68 @Captor
68 ArgumentCaptor<Callback<List<OfflinePageItem>>> mCallbackArgument; 69 ArgumentCaptor<Callback<List<OfflinePageItem>>> mCallbackArgument;
69 70
70 /** 71 /**
71 * Mocks the observer. 72 * Mocks the observer.
72 */ 73 */
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 238
238 mCallbackArgument.getValue().onResult(result); 239 mCallbackArgument.getValue().onResult(result);
239 240
240 return null; 241 return null;
241 } 242 }
242 }; 243 };
243 doAnswer(answer).when(mBridge).nativeGetAllPages( 244 doAnswer(answer).when(mBridge).nativeGetAllPages(
244 anyLong(), mResultArgument.capture(), mCallbackArgument.capture( )); 245 anyLong(), mResultArgument.capture(), mCallbackArgument.capture( ));
245 } 246 }
246 } 247 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698