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

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

Issue 318863008: Move ExtensionServiceTestBase into it's own header/cc file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge conflict Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_garbage_collector_unittest.cc
diff --git a/chrome/browser/extensions/extension_garbage_collector_unittest.cc b/chrome/browser/extensions/extension_garbage_collector_unittest.cc
index d04d3a4f3d900cb4f3c185fed171d7177c1b1fed..d4ce5d3f60a432aa3f06ec0c06eae119c3faf440 100644
--- a/chrome/browser/extensions/extension_garbage_collector_unittest.cc
+++ b/chrome/browser/extensions/extension_garbage_collector_unittest.cc
@@ -9,7 +9,8 @@
#include "base/threading/sequenced_worker_pool.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_garbage_collector.h"
-#include "chrome/browser/extensions/extension_service_unittest.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_constants.h"
@@ -75,7 +76,7 @@ TEST_F(ExtensionGarbageCollectorUnitTest, CleanupOnStartup) {
service_->Init();
GarbageCollectExtensions();
- base::FileEnumerator dirs(extensions_install_dir_,
+ base::FileEnumerator dirs(extensions_install_dir(),
false, // not recursive
base::FileEnumerator::DIRECTORIES);
size_t count = 0;
@@ -87,7 +88,7 @@ TEST_F(ExtensionGarbageCollectorUnitTest, CleanupOnStartup) {
// And extension1 dir should now be toast.
base::FilePath extension_dir =
- extensions_install_dir_.AppendASCII(kExtensionId);
+ extensions_install_dir().AppendASCII(kExtensionId);
ASSERT_FALSE(base::PathExists(extension_dir));
}
@@ -117,7 +118,7 @@ TEST_F(ExtensionGarbageCollectorUnitTest, NoCleanupDuringInstall) {
// extension1 dir should still exist.
base::FilePath extension_dir =
- extensions_install_dir_.AppendASCII(kExtensionId);
+ extensions_install_dir().AppendASCII(kExtensionId);
ASSERT_TRUE(base::PathExists(extension_dir));
// Finish CRX installation and re-run garbage collection.
@@ -134,7 +135,7 @@ TEST_F(ExtensionGarbageCollectorUnitTest, GarbageCollectWithPendingUpdates) {
InitPluginService();
base::FilePath source_install_dir =
- data_dir_.AppendASCII("pending_updates").AppendASCII("Extensions");
+ data_dir().AppendASCII("pending_updates").AppendASCII("Extensions");
base::FilePath pref_path =
source_install_dir.DirName().Append(chrome::kPreferencesFilename);
@@ -143,20 +144,20 @@ TEST_F(ExtensionGarbageCollectorUnitTest, GarbageCollectWithPendingUpdates) {
// This is the directory that is going to be deleted, so make sure it actually
// is there before the garbage collection.
- ASSERT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ ASSERT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/3")));
GarbageCollectExtensions();
// Verify that the pending update for the first extension didn't get
// deleted.
- EXPECT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0")));
- EXPECT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"bjafgdebaacbbbecmhlhpofkepfkgcpa/2.0")));
- EXPECT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/2")));
- EXPECT_FALSE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_FALSE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/3")));
}
@@ -165,7 +166,7 @@ TEST_F(ExtensionGarbageCollectorUnitTest, UpdateOnStartup) {
InitPluginService();
base::FilePath source_install_dir =
- data_dir_.AppendASCII("pending_updates").AppendASCII("Extensions");
+ data_dir().AppendASCII("pending_updates").AppendASCII("Extensions");
base::FilePath pref_path =
source_install_dir.DirName().Append(chrome::kPreferencesFilename);
@@ -174,20 +175,20 @@ TEST_F(ExtensionGarbageCollectorUnitTest, UpdateOnStartup) {
// This is the directory that is going to be deleted, so make sure it actually
// is there before the garbage collection.
- ASSERT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ ASSERT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/3")));
service_->Init();
GarbageCollectExtensions();
// Verify that the pending update for the first extension got installed.
- EXPECT_FALSE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_FALSE(base::PathExists(extensions_install_dir().AppendASCII(
"bjafgdebaacbbbecmhlhpofkepfkgcpa/1.0")));
- EXPECT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"bjafgdebaacbbbecmhlhpofkepfkgcpa/2.0")));
- EXPECT_TRUE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_TRUE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/2")));
- EXPECT_FALSE(base::PathExists(extensions_install_dir_.AppendASCII(
+ EXPECT_FALSE(base::PathExists(extensions_install_dir().AppendASCII(
"hpiknbiabeeppbpihjehijgoemciehgk/3")));
// Make sure update information got deleted.

Powered by Google App Engine
This is Rietveld 408576698