OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/common/extensions/extension_file_util.h" | 5 #include "chrome/common/extensions/extension_file_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" |
8 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
9 #include "base/string_util.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "base/path_service.h" | |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
13 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace keys = extension_manifest_keys; | 16 namespace keys = extension_manifest_keys; |
17 | 17 |
18 TEST(ExtensionFileUtil, MoveDirSafely) { | 18 TEST(ExtensionFileUtil, MoveDirSafely) { |
19 // Create a test directory structure with some data in it. | 19 // Create a test directory structure with some data in it. |
20 ScopedTempDir temp; | 20 ScopedTempDir temp; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 extension_file_util::ExtensionURLToRelativeFilePath(url); | 249 extension_file_util::ExtensionURLToRelativeFilePath(url); |
250 EXPECT_FALSE(actual_path.IsAbsolute()) << | 250 EXPECT_FALSE(actual_path.IsAbsolute()) << |
251 " For the path " << actual_path.value(); | 251 " For the path " << actual_path.value(); |
252 EXPECT_EQ(expected_path.value(), actual_path.value()); | 252 EXPECT_EQ(expected_path.value(), actual_path.value()); |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 // TODO(aa): More tests as motivation allows. Maybe steal some from | 256 // TODO(aa): More tests as motivation allows. Maybe steal some from |
257 // ExtensionsService? Many of them could probably be tested here without the | 257 // ExtensionsService? Many of them could probably be tested here without the |
258 // MessageLoop shenanigans. | 258 // MessageLoop shenanigans. |
OLD | NEW |