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/extension_action_icon_factory.h" | 5 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 EXPECT_FALSE(true); | 104 EXPECT_FALSE(true); |
105 return NULL; | 105 return NULL; |
106 } | 106 } |
107 test_file = test_file.AppendASCII("extensions/api_test").AppendASCII(name); | 107 test_file = test_file.AppendASCII("extensions/api_test").AppendASCII(name); |
108 int error_code = 0; | 108 int error_code = 0; |
109 std::string error; | 109 std::string error; |
110 JSONFileValueDeserializer deserializer( | 110 JSONFileValueDeserializer deserializer( |
111 test_file.AppendASCII("manifest.json")); | 111 test_file.AppendASCII("manifest.json")); |
112 scoped_ptr<base::DictionaryValue> valid_value( | 112 scoped_ptr<base::DictionaryValue> valid_value( |
113 static_cast<base::DictionaryValue*>( | 113 static_cast<base::DictionaryValue*>( |
114 deserializer.Deserialize(&error_code, | 114 deserializer.Deserialize(&error_code, &error).release())); |
115 &error))); | |
116 EXPECT_EQ(0, error_code) << error; | 115 EXPECT_EQ(0, error_code) << error; |
117 if (error_code != 0) | 116 if (error_code != 0) |
118 return NULL; | 117 return NULL; |
119 | 118 |
120 EXPECT_TRUE(valid_value.get()); | 119 EXPECT_TRUE(valid_value.get()); |
121 if (!valid_value) | 120 if (!valid_value) |
122 return NULL; | 121 return NULL; |
123 | 122 |
124 scoped_refptr<Extension> extension = | 123 scoped_refptr<Extension> extension = |
125 Extension::Create(test_file, location, *valid_value, | 124 Extension::Create(test_file, location, *valid_value, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 icon = icon_factory.GetIcon(1); | 291 icon = icon_factory.GetIcon(1); |
293 | 292 |
294 EXPECT_TRUE(ImageRepsAreEqual( | 293 EXPECT_TRUE(ImageRepsAreEqual( |
295 default_icon.ToImageSkia()->GetRepresentation(1.0f), | 294 default_icon.ToImageSkia()->GetRepresentation(1.0f), |
296 icon.ToImageSkia()->GetRepresentation(1.0f))); | 295 icon.ToImageSkia()->GetRepresentation(1.0f))); |
297 | 296 |
298 } | 297 } |
299 | 298 |
300 } // namespace | 299 } // namespace |
301 } // namespace extensions | 300 } // namespace extensions |
OLD | NEW |