Chromium Code Reviews| 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..47eab0a0b8371621a32d67c2f6af118c66c18bbd 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,38 @@ TEST_F(ExtensionServiceTest, ExternalPrefProvider) { |
| " }" |
| "}"; |
| EXPECT_EQ(1, was_installed_by_eom_visitor.Visit(json_data)); |
| + |
| +#if defined(OS_CHROMEOS) |
|
asargent_no_longer_on_chrome
2015/05/11 19:03:05
Can we remove the OS_CHROMEOS ifdef here too?
Dmitry Polukhin
2015/05/12 14:52:18
Done. Sorry, I forgot about this ifdef.
|
| + // 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)); |
| +#endif // OS_CHROMEOS |
| } |
| // Test loading good extensions from the profile directory. |