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

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

Issue 6292007: Fix autoupdate for hosted apps.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
===================================================================
--- chrome/browser/extensions/extension_service_unittest.cc (revision 71724)
+++ chrome/browser/extensions/extension_service_unittest.cc (working copy)
@@ -1639,6 +1639,28 @@
ValidatePrefKeyCount(pref_count);
}
+TEST_F(ExtensionServiceTest, UpdateApps) {
+ InitializeEmptyExtensionService();
+ FilePath extensions_path;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &extensions_path));
+ extensions_path =
+ extensions_path.AppendASCII("extensions").AppendASCII("app_update");
+
+ // First install v1 of a hosted app.
+ InstallExtension(extensions_path.AppendASCII("v1.crx"), true);
+ ASSERT_EQ(1u, service_->extensions()->size());
+ std::string id = service_->extensions()->at(0)->id();
+ ASSERT_EQ(std::string("1"),
+ service_->extensions()->at(0)->version()->GetString());
+
+ // Now try updating to v2.
+ UpdateExtension(id,
+ extensions_path.AppendASCII("v2.crx"),
+ ENABLED);
+ ASSERT_EQ(std::string("2"),
+ service_->extensions()->at(0)->version()->GetString());
+}
+
TEST_F(ExtensionServiceTest, InstallAppsWithUnlimtedStorage) {
InitializeEmptyExtensionService();
EXPECT_TRUE(service_->extensions()->empty());

Powered by Google App Engine
This is Rietveld 408576698