| 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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 base::FilePath test_file; | 66 base::FilePath test_file; |
| 67 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_file)) { | 67 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_file)) { |
| 68 EXPECT_FALSE(true); | 68 EXPECT_FALSE(true); |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| 71 test_file = test_file.AppendASCII("extensions") | 71 test_file = test_file.AppendASCII("extensions") |
| 72 .AppendASCII(name); | 72 .AppendASCII(name); |
| 73 int error_code = 0; | 73 int error_code = 0; |
| 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<base::DictionaryValue> valid_value( |
| 77 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, | 77 static_cast<base::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) | 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)) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 252 |
| 253 #if defined(FILE_MANAGER_EXTENSION) | 253 #if defined(FILE_MANAGER_EXTENSION) |
| 254 int resource_id; | 254 int resource_id; |
| 255 ASSERT_EQ(true, | 255 ASSERT_EQ(true, |
| 256 ImageLoader::IsComponentExtensionResource(extension->path(), | 256 ImageLoader::IsComponentExtensionResource(extension->path(), |
| 257 resource.relative_path(), | 257 resource.relative_path(), |
| 258 &resource_id)); | 258 &resource_id)); |
| 259 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); | 259 ASSERT_EQ(IDR_FILE_MANAGER_ICON_16, resource_id); |
| 260 #endif | 260 #endif |
| 261 } | 261 } |
| OLD | NEW |