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

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

Issue 1991443002: 🏦 Clean up unnecessary parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix findbugs. Created 4 years, 7 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/document/StorageDelegate.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 1e6c4324875525e62fb01d7b807e5e5b2fa05574..89504bf4bc65f8af523a6c38692e9e02c139346c 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
@@ -36,8 +36,7 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
return TabPersistentStore.serializeTabModelSelector(selector, null);
}
});
- File f = TabPersistentStore.getStateDirectory(
- getInstrumentation().getTargetContext(), index);
+ File f = TabPersistentStore.getOrCreateSelectorStateDirectory(index);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(new File(f, TabPersistentStore.SAVED_STATE_FILE));
@@ -87,11 +86,10 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
MockTabModelSelector selector = new MockTabModelSelector(0, 0, null);
TabPersistentStore store = new TabPersistentStore(selector, 0,
getInstrumentation().getTargetContext(), null, null);
- TabPersistentStore.waitForMigrationToFinish();
+ store.waitForMigrationToFinish();
// Check that the files were moved.
- File newDir =
- TabPersistentStore.getStateDirectory(getInstrumentation().getTargetContext(), 0);
+ File newDir = TabPersistentStore.getOrCreateSelectorStateDirectory(0);
File newStateFile = new File(newDir, TabPersistentStore.SAVED_STATE_FILE);
File newTab0 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0");
File newTab1 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "1");
@@ -140,8 +138,7 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
assertTrue("Could not create tab 3 file", tab3.createNewFile());
// Write new state files
- File newDir =
- TabPersistentStore.getStateDirectory(getInstrumentation().getTargetContext(), 0);
+ File newDir = TabPersistentStore.getOrCreateSelectorStateDirectory(0);
File newStateFile = new File(newDir, TabPersistentStore.SAVED_STATE_FILE);
File newTab4 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "4");
@@ -152,7 +149,7 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
MockTabModelSelector selector = new MockTabModelSelector(0, 0, null);
TabPersistentStore store = new TabPersistentStore(selector, 0,
getInstrumentation().getTargetContext(), null, null);
- TabPersistentStore.waitForMigrationToFinish();
+ store.waitForMigrationToFinish();
assertTrue("Could not find new state file", newStateFile.exists());
assertTrue("Could not find new tab 4 file", newTab4.exists());
@@ -198,15 +195,14 @@ public class RestoreMigrateTest extends InstrumentationTestCase {
MockTabModelSelector selector = new MockTabModelSelector(0, 0, null);
TabPersistentStore store = new TabPersistentStore(selector, 0,
getInstrumentation().getTargetContext(), null, null);
- TabPersistentStore.waitForMigrationToFinish();
+ store.waitForMigrationToFinish();
assertFalse("Could still find old state file", stateFile.exists());
assertFalse("Could still find old tab 0 file", tab0.exists());
assertTrue("Could not find other file", otherFile.exists());
// Check that the files were moved.
- File newDir =
- TabPersistentStore.getStateDirectory(getInstrumentation().getTargetContext(), 0);
+ File newDir = TabPersistentStore.getOrCreateSelectorStateDirectory(0);
File newStateFile = new File(newDir, TabPersistentStore.SAVED_STATE_FILE);
File newTab0 = new File(newDir, TabState.SAVED_TAB_STATE_FILE_PREFIX + "0");
File newOtherFile = new File(newDir, "other.file");
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/tabmodel/document/StorageDelegate.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698