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

Unified Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 2930183002: Let IndexedDBContextImpl create its own task runner (Closed)
Patch Set: rebased Created 3 years, 5 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
Index: chrome/browser/extensions/extension_service_unittest.cc
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 189b8b41ef4a7d6fa8448cbc4c11fd5665a97e22..12b072733fb3f653ff75237432ac4a04ac039b9a 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -4622,14 +4622,14 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) {
EXPECT_TRUE(base::PathExists(lso_file_path));
// Create indexed db. Similarly, it is enough to only simulate this by
- // creating the directory on the disk.
+ // creating the directory on the disk, and resetting the caches of
+ // "known" origins.
IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition(
profile())->GetIndexedDBContext();
- idb_context->SetTaskRunnerForTesting(
- base::ThreadTaskRunnerHandle::Get().get());
base::FilePath idb_path = idb_context->GetFilePathForTesting(ext_url);
EXPECT_TRUE(base::CreateDirectory(idb_path));
EXPECT_TRUE(base::DirectoryExists(idb_path));
+ idb_context->ResetCachesForTesting();
// Uninstall the extension.
base::RunLoop run_loop;
@@ -4743,14 +4743,14 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
EXPECT_TRUE(base::PathExists(lso_file_path));
// Create indexed db. Similarly, it is enough to only simulate this by
- // creating the directory on the disk.
+ // creating the directory on the disk, and resetting the caches of
+ // "known" origins.
IndexedDBContext* idb_context = BrowserContext::GetDefaultStoragePartition(
profile())->GetIndexedDBContext();
- idb_context->SetTaskRunnerForTesting(
- base::ThreadTaskRunnerHandle::Get().get());
base::FilePath idb_path = idb_context->GetFilePathForTesting(origin1);
EXPECT_TRUE(base::CreateDirectory(idb_path));
EXPECT_TRUE(base::DirectoryExists(idb_path));
+ idb_context->ResetCachesForTesting();
// Uninstall one of them, unlimited storage should still be granted
// to the origin.

Powered by Google App Engine
This is Rietveld 408576698