OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "extensions/browser/component_extension_resource_manager.h" | 9 #include "extensions/browser/component_extension_resource_manager.h" |
10 #include "extensions/browser/extensions_browser_client.h" | 10 #include "extensions/browser/extensions_browser_client.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager(); | 32 ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager(); |
33 ASSERT_TRUE(resource_manager); | 33 ASSERT_TRUE(resource_manager); |
34 | 34 |
35 // Get the extension test data path. | 35 // Get the extension test data path. |
36 base::FilePath test_path; | 36 base::FilePath test_path; |
37 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path)); | 37 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_path)); |
38 test_path = test_path.AppendASCII("extensions").AppendASCII("file_manager"); | 38 test_path = test_path.AppendASCII("extensions").AppendASCII("file_manager"); |
39 | 39 |
40 // Load the manifest data. | 40 // Load the manifest data. |
41 std::string error; | 41 std::string error; |
42 scoped_ptr<base::DictionaryValue> manifest(file_util::LoadManifest( | 42 std::unique_ptr<base::DictionaryValue> manifest(file_util::LoadManifest( |
43 test_path, FILE_PATH_LITERAL("app.json"), &error)); | 43 test_path, FILE_PATH_LITERAL("app.json"), &error)); |
44 ASSERT_TRUE(manifest.get()) << error; | 44 ASSERT_TRUE(manifest.get()) << error; |
45 | 45 |
46 // Build a path inside Chrome's resources directory where a component | 46 // Build a path inside Chrome's resources directory where a component |
47 // extension might be installed. | 47 // extension might be installed. |
48 base::FilePath resources_path; | 48 base::FilePath resources_path; |
49 ASSERT_TRUE(PathService::Get(chrome::DIR_RESOURCES, &resources_path)); | 49 ASSERT_TRUE(PathService::Get(chrome::DIR_RESOURCES, &resources_path)); |
50 resources_path = resources_path.AppendASCII("file_manager"); | 50 resources_path = resources_path.AppendASCII("file_manager"); |
51 | 51 |
52 // Create a simulated component extension. | 52 // Create a simulated component extension. |
(...skipping 13 matching lines...) Expand all Loading... |
66 #if defined(OS_CHROMEOS) | 66 #if defined(OS_CHROMEOS) |
67 // The resource is a component resource. | 67 // The resource is a component resource. |
68 int resource_id = 0; | 68 int resource_id = 0; |
69 ASSERT_TRUE(resource_manager->IsComponentExtensionResource( | 69 ASSERT_TRUE(resource_manager->IsComponentExtensionResource( |
70 extension->path(), resource.relative_path(), &resource_id)); | 70 extension->path(), resource.relative_path(), &resource_id)); |
71 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); | 71 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); |
72 #endif | 72 #endif |
73 } | 73 } |
74 | 74 |
75 } // namespace extensions | 75 } // namespace extensions |
OLD | NEW |