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/file_util.h" | 8 #include "base/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.h" | 10 #include "base/message_loop.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 std::string error; | 107 std::string error; |
108 JSONFileValueSerializer serializer(test_file.AppendASCII("manifest.json")); | 108 JSONFileValueSerializer serializer(test_file.AppendASCII("manifest.json")); |
109 scoped_ptr<DictionaryValue> valid_value( | 109 scoped_ptr<DictionaryValue> valid_value( |
110 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, | 110 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, |
111 &error))); | 111 &error))); |
112 EXPECT_EQ(0, error_code) << error; | 112 EXPECT_EQ(0, error_code) << error; |
113 if (error_code != 0) | 113 if (error_code != 0) |
114 return NULL; | 114 return NULL; |
115 | 115 |
116 EXPECT_TRUE(valid_value.get()); | 116 EXPECT_TRUE(valid_value.get()); |
117 if (!valid_value.get()) | 117 if (!valid_value) |
118 return NULL; | 118 return NULL; |
119 | 119 |
120 scoped_refptr<Extension> extension = | 120 scoped_refptr<Extension> extension = |
121 Extension::Create(test_file, location, *valid_value, | 121 Extension::Create(test_file, location, *valid_value, |
122 Extension::NO_FLAGS, &error); | 122 Extension::NO_FLAGS, &error); |
123 EXPECT_TRUE(extension) << error; | 123 EXPECT_TRUE(extension) << error; |
124 if (extension) | 124 if (extension) |
125 extension_service_->AddExtension(extension); | 125 extension_service_->AddExtension(extension); |
126 return extension; | 126 return extension; |
127 } | 127 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 icon = icon_factory.GetIcon(1); | 282 icon = icon_factory.GetIcon(1); |
283 | 283 |
284 EXPECT_TRUE(ImageRepsAreEqual( | 284 EXPECT_TRUE(ImageRepsAreEqual( |
285 default_icon.ToImageSkia()->GetRepresentation(ui::SCALE_FACTOR_100P), | 285 default_icon.ToImageSkia()->GetRepresentation(ui::SCALE_FACTOR_100P), |
286 icon.ToImageSkia()->GetRepresentation(ui::SCALE_FACTOR_100P))); | 286 icon.ToImageSkia()->GetRepresentation(ui::SCALE_FACTOR_100P))); |
287 | 287 |
288 } | 288 } |
289 | 289 |
290 } // namespace | 290 } // namespace |
291 } // namespace extensions | 291 } // namespace extensions |
OLD | NEW |