| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/extensions/external_cache.h" | 5 #include "chrome/browser/chromeos/extensions/external_cache.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 extensions::LocalExtensionCache::kCacheReadyFlagFileName)); | 103 extensions::LocalExtensionCache::kCacheReadyFlagFileName)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void CreateExtensionFile(const base::FilePath& dir, | 106 void CreateExtensionFile(const base::FilePath& dir, |
| 107 const std::string& id, | 107 const std::string& id, |
| 108 const std::string& version) { | 108 const std::string& version) { |
| 109 CreateFile(GetExtensionFile(dir, id, version)); | 109 CreateFile(GetExtensionFile(dir, id, version)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void CreateFile(const base::FilePath& file) { | 112 void CreateFile(const base::FilePath& file) { |
| 113 EXPECT_EQ(file_util::WriteFile(file, NULL, 0), 0); | 113 EXPECT_EQ(base::WriteFile(file, NULL, 0), 0); |
| 114 } | 114 } |
| 115 | 115 |
| 116 base::FilePath GetExtensionFile(const base::FilePath& dir, | 116 base::FilePath GetExtensionFile(const base::FilePath& dir, |
| 117 const std::string& id, | 117 const std::string& id, |
| 118 const std::string& version) { | 118 const std::string& version) { |
| 119 return dir.Append(id + "-" + version + ".crx"); | 119 return dir.Append(id + "-" + version + ".crx"); |
| 120 } | 120 } |
| 121 | 121 |
| 122 base::DictionaryValue* CreateEntryWithUpdateUrl(bool from_webstore) { | 122 base::DictionaryValue* CreateEntryWithUpdateUrl(bool from_webstore) { |
| 123 base::DictionaryValue* entry = new base::DictionaryValue; | 123 base::DictionaryValue* entry = new base::DictionaryValue; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); | 307 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); |
| 308 EXPECT_TRUE(entry1->HasKey( | 308 EXPECT_TRUE(entry1->HasKey( |
| 309 extensions::ExternalProviderImpl::kExternalUpdateUrl)); | 309 extensions::ExternalProviderImpl::kExternalUpdateUrl)); |
| 310 EXPECT_FALSE(entry1->HasKey( | 310 EXPECT_FALSE(entry1->HasKey( |
| 311 extensions::ExternalProviderImpl::kExternalCrx)); | 311 extensions::ExternalProviderImpl::kExternalCrx)); |
| 312 EXPECT_FALSE(entry1->HasKey( | 312 EXPECT_FALSE(entry1->HasKey( |
| 313 extensions::ExternalProviderImpl::kExternalVersion)); | 313 extensions::ExternalProviderImpl::kExternalVersion)); |
| 314 } | 314 } |
| 315 | 315 |
| 316 } // namespace chromeos | 316 } // namespace chromeos |
| OLD | NEW |