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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java
index 6abc5c0d48fe5f9948d21b7b2d297411df1baf65..84152a19d1165d3a793f938be94c37b2501f7fe3 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageSavePageLaterEvaluationTest.java
@@ -80,8 +80,9 @@ public class OfflinePageSavePageLaterEvaluationTest
private static final String INPUT_FILE_PATH = "paquete/offline_eval_urls.txt";
private static final String LOG_OUTPUT_FILE_PATH = "paquete/offline_eval_logs.txt";
private static final String RESULT_OUTPUT_FILE_PATH = "paquete/offline_eval_results.txt";
- private static final int GET_PAGES_TIMEOUT_MS = 5000;
- private static final int PAGE_MODEL_LOAD_TIMEOUT_MS = 5000;
+ private static final int GET_PAGES_TIMEOUT_MS = 30000;
+ private static final int PAGE_MODEL_LOAD_TIMEOUT_MS = 30000;
+ private static final int REMOVE_REQUESTS_TIMEOUT_MS = 30000;
private OfflinePageEvaluationBridge mBridge;
private OfflinePageEvaluationObserver mObserver;
@@ -110,11 +111,34 @@ public class OfflinePageSavePageLaterEvaluationTest
@Override
protected void tearDown() throws Exception {
- super.tearDown();
NotificationManager notificationManager =
(NotificationManager) ContextUtils.getApplicationContext().getSystemService(
Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();
+ final Semaphore mClearingSemaphore = new Semaphore(0);
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mBridge.getRequestsInQueue(new Callback<SavePageRequest[]>() {
+ @Override
+ public void onResult(SavePageRequest[] results) {
+ ArrayList<Long> ids = new ArrayList<Long>(results.length);
+ for (int i = 0; i < results.length; i++) {
+ ids.add(results[i].getRequestId());
+ }
+ mBridge.removeRequestsFromQueue(ids, new Callback<Integer>() {
+ @Override
+ public void onResult(Integer removedCount) {
+ mClearingSemaphore.release();
+ }
+ });
+ }
+ });
+ }
+ });
+ checkTrue(mClearingSemaphore.tryAcquire(REMOVE_REQUESTS_TIMEOUT_MS, TimeUnit.MILLISECONDS),
+ "Timed out when clearing remaining requests!");
+ super.tearDown();
}
@Override

Powered by Google App Engine
This is Rietveld 408576698