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

Side by Side Diff: chrome/browser/chromeos/extensions/external_cache_unittest.cc

Issue 2318023002: //chrome/browser/chromeos: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Address comment and also remove non-trivial cases Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 #include <utility> 10 #include <utility>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 std::string GetInstalledExtensionVersion(const std::string& id) override { 80 std::string GetInstalledExtensionVersion(const std::string& id) override {
81 std::map<std::string, std::string>::iterator it = 81 std::map<std::string, std::string>::iterator it =
82 installed_extensions_.find(id); 82 installed_extensions_.find(id);
83 return it != installed_extensions_.end() ? it->second : std::string(); 83 return it != installed_extensions_.end() ? it->second : std::string();
84 } 84 }
85 85
86 base::FilePath CreateCacheDir(bool initialized) { 86 base::FilePath CreateCacheDir(bool initialized) {
87 EXPECT_TRUE(cache_dir_.CreateUniqueTempDir()); 87 EXPECT_TRUE(cache_dir_.CreateUniqueTempDir());
88 if (initialized) 88 if (initialized)
89 CreateFlagFile(cache_dir_.path()); 89 CreateFlagFile(cache_dir_.GetPath());
90 return cache_dir_.path(); 90 return cache_dir_.GetPath();
91 } 91 }
92 92
93 base::FilePath CreateTempDir() { 93 base::FilePath CreateTempDir() {
94 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); 94 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
95 return temp_dir_.path(); 95 return temp_dir_.GetPath();
96 } 96 }
97 97
98 void CreateFlagFile(const base::FilePath& dir) { 98 void CreateFlagFile(const base::FilePath& dir) {
99 CreateFile(dir.Append( 99 CreateFile(dir.Append(
100 extensions::LocalExtensionCache::kCacheReadyFlagFileName)); 100 extensions::LocalExtensionCache::kCacheReadyFlagFileName));
101 } 101 }
102 102
103 void CreateExtensionFile(const base::FilePath& dir, 103 void CreateExtensionFile(const base::FilePath& dir,
104 const std::string& id, 104 const std::string& id,
105 const std::string& version) { 105 const std::string& version) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1)); 301 ASSERT_TRUE(provided_prefs()->GetDictionary(kTestExtensionId1, &entry1));
302 EXPECT_TRUE(entry1->HasKey( 302 EXPECT_TRUE(entry1->HasKey(
303 extensions::ExternalProviderImpl::kExternalUpdateUrl)); 303 extensions::ExternalProviderImpl::kExternalUpdateUrl));
304 EXPECT_FALSE(entry1->HasKey( 304 EXPECT_FALSE(entry1->HasKey(
305 extensions::ExternalProviderImpl::kExternalCrx)); 305 extensions::ExternalProviderImpl::kExternalCrx));
306 EXPECT_FALSE(entry1->HasKey( 306 EXPECT_FALSE(entry1->HasKey(
307 extensions::ExternalProviderImpl::kExternalVersion)); 307 extensions::ExternalProviderImpl::kExternalVersion));
308 } 308 }
309 309
310 } // namespace chromeos 310 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698