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

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

Issue 1128753003: Add minimal profile creation version for default apps install on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed #ifdef Created 5 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 | « no previous file | chrome/browser/extensions/external_provider_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4352ffaeb95eae46d7ae4fde5bbee9bde7c477eb..308af8002eb11f7debca675029444793890152aa 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -461,6 +461,8 @@ class MockProviderVisitor
EXPECT_TRUE(provider->IsReady());
}
+ Profile* profile() { return profile_.get(); }
+
private:
int ids_found_;
base::FilePath fake_base_path_;
@@ -5533,6 +5535,36 @@ TEST_F(ExtensionServiceTest, ExternalPrefProvider) {
" }"
"}";
EXPECT_EQ(1, was_installed_by_eom_visitor.Visit(json_data));
+
+ // Test min_profile_created_by_version.
+ MockProviderVisitor min_profile_created_by_version_visitor(base_path);
+ json_data =
+ "{"
+ " \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\": {"
+ " \"external_crx\": \"RandomExtension.crx\","
+ " \"external_version\": \"1.0\","
+ " \"min_profile_created_by_version\": \"42.0.0.1\""
+ " },"
+ " \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\": {"
+ " \"external_crx\": \"RandomExtension2.crx\","
+ " \"external_version\": \"1.0\","
+ " \"min_profile_created_by_version\": \"43.0.0.1\""
+ " },"
+ " \"cccccccccccccccccccccccccccccccc\": {"
+ " \"external_crx\": \"RandomExtension3.crx\","
+ " \"external_version\": \"3.0\","
+ " \"min_profile_created_by_version\": \"44.0.0.1\""
+ " }"
+ "}";
+ min_profile_created_by_version_visitor.profile()->GetPrefs()->SetString(
+ prefs::kProfileCreatedByVersion, "40.0.0.1");
+ EXPECT_EQ(0, min_profile_created_by_version_visitor.Visit(json_data));
+ min_profile_created_by_version_visitor.profile()->GetPrefs()->SetString(
+ prefs::kProfileCreatedByVersion, "43.0.0.1");
+ EXPECT_EQ(2, min_profile_created_by_version_visitor.Visit(json_data));
+ min_profile_created_by_version_visitor.profile()->GetPrefs()->SetString(
+ prefs::kProfileCreatedByVersion, "45.0.0.1");
+ EXPECT_EQ(3, min_profile_created_by_version_visitor.Visit(json_data));
}
// Test loading good extensions from the profile directory.
« no previous file with comments | « no previous file | chrome/browser/extensions/external_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698