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

Unified Diff: chrome/browser/sync/test/integration/sync_extension_helper.cc

Issue 10541126: Cleaning Up Extensions When Local Content Removed (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master merge Created 8 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
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/sync_extension_helper.cc
diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc
index a2151aceee1ffeb00229eed30f4bec08cb2cf063..c719aa050d20672e9eacb2d30b3c039c02c4da3c 100644
--- a/chrome/browser/sync/test/integration/sync_extension_helper.cc
+++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc
@@ -18,6 +18,8 @@
#include "chrome/common/string_ordinal.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
using extensions::Extension;
@@ -70,6 +72,16 @@ std::string SyncExtensionHelper::InstallExtension(
NOTREACHED() << "Could not install extension " << name;
return "";
}
+ // extensions::ExtensionGarbageCollector requires that there be a file present
+ // on the file system for all extensions; we mimic this here. This also better
+ // simulates the actual install process.
+ content::BrowserThread::PostTask(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(
+ base::IgnoreResult(&file_util::CreateDirectory),
+ profile->GetExtensionService()->install_directory()
+ .AppendASCII(extension->id())));
+ ui_test_utils::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
profile->GetExtensionService()->OnExtensionInstalled(
extension, extension->UpdatesFromGallery(), StringOrdinal());
return extension->id();
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698