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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java

Issue 1711063002: Avoid disk reads in TabPersistentStore for max tab_id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add refactoring to this CL. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java
index c7857abe7a9f824a229fd1ccae18fd88e0f2832a..1e6c4324875525e62fb01d7b807e5e5b2fa05574 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/RestoreMigrateTest.java
@@ -12,6 +12,8 @@ import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.TabState;
+import org.chromium.chrome.browser.tab.Tab;
+import org.chromium.chrome.browser.tab.TabIdManager;
import org.chromium.chrome.test.util.ApplicationData;
import org.chromium.chrome.test.util.browser.tabmodel.MockTabModelSelector;
@@ -234,7 +236,9 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
int maxId = Math.max(getMaxId(selector0), getMaxId(selector1));
RecordHistogram.disableForTests();
- assertEquals("Invalid next id", maxId + 1, storeIn.loadStateInternal());
+ storeIn.loadState();
+ assertEquals("Invalid next id", maxId + 1,
+ TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID));
}
/**
@@ -261,8 +265,8 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
getInstrumentation().getTargetContext(), null, null);
RecordHistogram.disableForTests();
- storeIn0.loadStateInternal();
- storeIn1.loadStateInternal();
+ storeIn0.loadState();
+ storeIn1.loadState();
assertEquals("Unexpected number of tabs to load", 6, storeIn0.getRestoredTabCount());
assertEquals("Unexpected number of tabst o load", 3, storeIn1.getRestoredTabCount());
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698