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 "chrome/browser/extensions/image_loader.h" | 5 #include "chrome/browser/extensions/image_loader.h" |
6 | 6 |
7 #include "base/json/json_file_value_serializer.h" | 7 #include "base/json/json_file_value_serializer.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::string error; | 74 std::string error; |
75 JSONFileValueSerializer serializer(test_file.AppendASCII("app.json")); | 75 JSONFileValueSerializer serializer(test_file.AppendASCII("app.json")); |
76 scoped_ptr<DictionaryValue> valid_value( | 76 scoped_ptr<DictionaryValue> valid_value( |
77 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, | 77 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, |
78 &error))); | 78 &error))); |
79 EXPECT_EQ(0, error_code) << error; | 79 EXPECT_EQ(0, error_code) << error; |
80 if (error_code != 0) | 80 if (error_code != 0) |
81 return NULL; | 81 return NULL; |
82 | 82 |
83 EXPECT_TRUE(valid_value.get()); | 83 EXPECT_TRUE(valid_value.get()); |
84 if (!valid_value.get()) | 84 if (!valid_value) |
85 return NULL; | 85 return NULL; |
86 | 86 |
87 if (location == Manifest::COMPONENT) { | 87 if (location == Manifest::COMPONENT) { |
88 if (!PathService::Get(chrome::DIR_RESOURCES, &test_file)) { | 88 if (!PathService::Get(chrome::DIR_RESOURCES, &test_file)) { |
89 EXPECT_FALSE(true); | 89 EXPECT_FALSE(true); |
90 return NULL; | 90 return NULL; |
91 } | 91 } |
92 test_file = test_file.AppendASCII(name); | 92 test_file = test_file.AppendASCII(name); |
93 } | 93 } |
94 return Extension::Create(test_file, location, *valid_value, | 94 return Extension::Create(test_file, location, *valid_value, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 #if defined(FILE_MANAGER_EXTENSION) | 259 #if defined(FILE_MANAGER_EXTENSION) |
260 int resource_id; | 260 int resource_id; |
261 ASSERT_EQ(true, | 261 ASSERT_EQ(true, |
262 ImageLoader::IsComponentExtensionResource(extension->path(), | 262 ImageLoader::IsComponentExtensionResource(extension->path(), |
263 resource.relative_path(), | 263 resource.relative_path(), |
264 &resource_id)); | 264 &resource_id)); |
265 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); | 265 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); |
266 #endif | 266 #endif |
267 } | 267 } |
OLD | NEW |