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

Side by Side Diff: chrome/common/extensions/extension_resource_unittest.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ScopedTempDir temp; 109 ScopedTempDir temp;
110 ASSERT_TRUE(temp.CreateUniqueTempDir()); 110 ASSERT_TRUE(temp.CreateUniqueTempDir());
111 111
112 // Create resource in the extension root. 112 // Create resource in the extension root.
113 const char* filename = "res.ico"; 113 const char* filename = "res.ico";
114 FilePath root_resource = temp.path().AppendASCII(filename); 114 FilePath root_resource = temp.path().AppendASCII(filename);
115 std::string data = "some foo"; 115 std::string data = "some foo";
116 ASSERT_TRUE(file_util::WriteFile(root_resource, data.c_str(), data.length())); 116 ASSERT_TRUE(file_util::WriteFile(root_resource, data.c_str(), data.length()));
117 117
118 // Create l10n resources (for current locale and its parents). 118 // Create l10n resources (for current locale and its parents).
119 FilePath l10n_path = temp.path().Append(Extension::kLocaleFolder); 119 FilePath l10n_path = temp.path().Append(extensions::Extension::kLocaleFolder);
120 ASSERT_TRUE(file_util::CreateDirectory(l10n_path)); 120 ASSERT_TRUE(file_util::CreateDirectory(l10n_path));
121 121
122 std::vector<std::string> locales; 122 std::vector<std::string> locales;
123 l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(""), &locales); 123 l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(""), &locales);
124 ASSERT_FALSE(locales.empty()); 124 ASSERT_FALSE(locales.empty());
125 for (size_t i = 0; i < locales.size(); i++) { 125 for (size_t i = 0; i < locales.size(); i++) {
126 FilePath make_path; 126 FilePath make_path;
127 make_path = l10n_path.AppendASCII(locales[i]); 127 make_path = l10n_path.AppendASCII(locales[i]);
128 ASSERT_TRUE(file_util::CreateDirectory(make_path)); 128 ASSERT_TRUE(file_util::CreateDirectory(make_path));
129 ASSERT_TRUE(file_util::WriteFile(make_path.AppendASCII(filename), 129 ASSERT_TRUE(file_util::WriteFile(make_path.AppendASCII(filename),
(...skipping 11 matching lines...) Expand all
141 // See http://crbug.com/27359. 141 // See http://crbug.com/27359.
142 expected_path = root_resource; 142 expected_path = root_resource;
143 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); 143 ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
144 144
145 EXPECT_EQ(ToLower(expected_path.value()), ToLower(resolved_path.value())); 145 EXPECT_EQ(ToLower(expected_path.value()), ToLower(resolved_path.value()));
146 EXPECT_EQ(ToLower(temp.path().value()), 146 EXPECT_EQ(ToLower(temp.path().value()),
147 ToLower(resource.extension_root().value())); 147 ToLower(resource.extension_root().value()));
148 EXPECT_EQ(ToLower(FilePath().AppendASCII(filename).value()), 148 EXPECT_EQ(ToLower(FilePath().AppendASCII(filename).value()),
149 ToLower(resource.relative_path().value())); 149 ToLower(resource.relative_path().value()));
150 } 150 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_process_policy.cc ('k') | chrome/common/extensions/extension_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698