OLD | NEW |
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/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 base::FilePath path; | 144 base::FilePath path; |
145 std::string extension_id = id_util::GenerateId("test"); | 145 std::string extension_id = id_util::GenerateId("test"); |
146 ExtensionResource resource(extension_id, temp.path(), | 146 ExtensionResource resource(extension_id, temp.path(), |
147 base::FilePath().AppendASCII(filename)); | 147 base::FilePath().AppendASCII(filename)); |
148 base::FilePath resolved_path = resource.GetFilePath(); | 148 base::FilePath resolved_path = resource.GetFilePath(); |
149 | 149 |
150 base::FilePath expected_path; | 150 base::FilePath expected_path; |
151 // Expect default path only, since fallback logic is disabled. | 151 // Expect default path only, since fallback logic is disabled. |
152 // See http://crbug.com/27359. | 152 // See http://crbug.com/27359. |
153 expected_path = root_resource; | 153 expected_path = root_resource.AsAbsolute(); |
154 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); | 154 ASSERT_FALSE(expected_path.empty()); |
155 | 155 |
156 EXPECT_EQ(ToLower(expected_path.value()), ToLower(resolved_path.value())); | 156 EXPECT_EQ(ToLower(expected_path.value()), ToLower(resolved_path.value())); |
157 EXPECT_EQ(ToLower(temp.path().value()), | 157 EXPECT_EQ(ToLower(temp.path().value()), |
158 ToLower(resource.extension_root().value())); | 158 ToLower(resource.extension_root().value())); |
159 EXPECT_EQ(ToLower(base::FilePath().AppendASCII(filename).value()), | 159 EXPECT_EQ(ToLower(base::FilePath().AppendASCII(filename).value()), |
160 ToLower(resource.relative_path().value())); | 160 ToLower(resource.relative_path().value())); |
161 } | 161 } |
162 | 162 |
163 } // namespace extensions | 163 } // namespace extensions |
OLD | NEW |