| 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 "extensions/browser/image_loader.h" | 5 #include "extensions/browser/image_loader.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 EXPECT_FALSE(true); | 78 EXPECT_FALSE(true); |
| 79 return NULL; | 79 return NULL; |
| 80 } | 80 } |
| 81 extension_dir = extension_dir.AppendASCII(dir_name); | 81 extension_dir = extension_dir.AppendASCII(dir_name); |
| 82 int error_code = 0; | 82 int error_code = 0; |
| 83 std::string error; | 83 std::string error; |
| 84 JSONFileValueDeserializer deserializer( | 84 JSONFileValueDeserializer deserializer( |
| 85 extension_dir.AppendASCII("manifest.json")); | 85 extension_dir.AppendASCII("manifest.json")); |
| 86 scoped_ptr<base::DictionaryValue> valid_value( | 86 scoped_ptr<base::DictionaryValue> valid_value( |
| 87 static_cast<base::DictionaryValue*>( | 87 static_cast<base::DictionaryValue*>( |
| 88 deserializer.Deserialize(&error_code, &error))); | 88 deserializer.Deserialize(&error_code, &error).release())); |
| 89 EXPECT_EQ(0, error_code) << error; | 89 EXPECT_EQ(0, error_code) << error; |
| 90 if (error_code != 0) | 90 if (error_code != 0) |
| 91 return NULL; | 91 return NULL; |
| 92 | 92 |
| 93 EXPECT_TRUE(valid_value.get()); | 93 EXPECT_TRUE(valid_value.get()); |
| 94 if (!valid_value) | 94 if (!valid_value) |
| 95 return NULL; | 95 return NULL; |
| 96 | 96 |
| 97 return Extension::Create( | 97 return Extension::Create( |
| 98 extension_dir, location, *valid_value, Extension::NO_FLAGS, &error); | 98 extension_dir, location, *valid_value, Extension::NO_FLAGS, &error); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 const gfx::ImageSkiaRep* img_rep1 = &image_reps[0]; | 303 const gfx::ImageSkiaRep* img_rep1 = &image_reps[0]; |
| 304 const gfx::ImageSkiaRep* img_rep2 = &image_reps[1]; | 304 const gfx::ImageSkiaRep* img_rep2 = &image_reps[1]; |
| 305 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, img_rep1->pixel_width()); | 305 EXPECT_EQ(extension_misc::EXTENSION_ICON_BITTY, img_rep1->pixel_width()); |
| 306 EXPECT_EQ(1.0f, img_rep1->scale()); | 306 EXPECT_EQ(1.0f, img_rep1->scale()); |
| 307 EXPECT_EQ(extension_misc::EXTENSION_ICON_SMALLISH, img_rep2->pixel_width()); | 307 EXPECT_EQ(extension_misc::EXTENSION_ICON_SMALLISH, img_rep2->pixel_width()); |
| 308 EXPECT_EQ(2.0f, img_rep2->scale()); | 308 EXPECT_EQ(2.0f, img_rep2->scale()); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace extensions | 311 } // namespace extensions |
| OLD | NEW |