| 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_icon_image.h" | 5 #include "chrome/browser/extensions/extension_icon_image.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/browser/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 std::string error; | 155 std::string error; |
| 156 JSONFileValueSerializer serializer(test_file.AppendASCII("app.json")); | 156 JSONFileValueSerializer serializer(test_file.AppendASCII("app.json")); |
| 157 scoped_ptr<DictionaryValue> valid_value( | 157 scoped_ptr<DictionaryValue> valid_value( |
| 158 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, | 158 static_cast<DictionaryValue*>(serializer.Deserialize(&error_code, |
| 159 &error))); | 159 &error))); |
| 160 EXPECT_EQ(0, error_code) << error; | 160 EXPECT_EQ(0, error_code) << error; |
| 161 if (error_code != 0) | 161 if (error_code != 0) |
| 162 return NULL; | 162 return NULL; |
| 163 | 163 |
| 164 EXPECT_TRUE(valid_value.get()); | 164 EXPECT_TRUE(valid_value.get()); |
| 165 if (!valid_value.get()) | 165 if (!valid_value) |
| 166 return NULL; | 166 return NULL; |
| 167 | 167 |
| 168 return Extension::Create(test_file, location, *valid_value, | 168 return Extension::Create(test_file, location, *valid_value, |
| 169 Extension::NO_FLAGS, &error); | 169 Extension::NO_FLAGS, &error); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // testing::Test overrides: | 172 // testing::Test overrides: |
| 173 virtual void SetUp() OVERRIDE { | 173 virtual void SetUp() OVERRIDE { |
| 174 file_thread_.Start(); | 174 file_thread_.Start(); |
| 175 io_thread_.Start(); | 175 io_thread_.Start(); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 EXPECT_EQ(16, representation.pixel_width()); | 547 EXPECT_EQ(16, representation.pixel_width()); |
| 548 EXPECT_TRUE(gfx::BitmapsAreEqual(representation.sk_bitmap(), bitmap_16)); | 548 EXPECT_TRUE(gfx::BitmapsAreEqual(representation.sk_bitmap(), bitmap_16)); |
| 549 | 549 |
| 550 // When requesting another representation, we should get blank image. | 550 // When requesting another representation, we should get blank image. |
| 551 representation = image_skia.GetRepresentation(ui::SCALE_FACTOR_200P); | 551 representation = image_skia.GetRepresentation(ui::SCALE_FACTOR_200P); |
| 552 | 552 |
| 553 EXPECT_TRUE(gfx::BitmapsAreEqual( | 553 EXPECT_TRUE(gfx::BitmapsAreEqual( |
| 554 representation.sk_bitmap(), | 554 representation.sk_bitmap(), |
| 555 CreateBlankBitmapForScale(16, ui::SCALE_FACTOR_200P))); | 555 CreateBlankBitmapForScale(16, ui::SCALE_FACTOR_200P))); |
| 556 } | 556 } |
| OLD | NEW |