| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/browser/chrome_thread.h" | 7 #include "chrome/browser/chrome_thread.h" |
| 8 #include "chrome/browser/extensions/image_loading_tracker.h" | 8 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "chrome/common/extensions/extension_resource.h" | 11 #include "chrome/common/extensions/extension_resource.h" |
| 12 #include "chrome/common/json_value_serializer.h" | 12 #include "chrome/common/json_value_serializer.h" |
| 13 #include "chrome/common/notification_service.h" | 13 #include "chrome/common/notification_service.h" |
| 14 #include "chrome/common/notification_type.h" | 14 #include "chrome/common/notification_type.h" |
| 15 #include "gfx/size.h" | 15 #include "gfx/size.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 | 18 |
| 18 class ImageLoadingTrackerTest : public testing::Test, | 19 class ImageLoadingTrackerTest : public testing::Test, |
| 19 public ImageLoadingTracker::Observer { | 20 public ImageLoadingTracker::Observer { |
| 20 public: | 21 public: |
| 21 ImageLoadingTrackerTest() | 22 ImageLoadingTrackerTest() |
| 22 : image_loaded_count_(0), | 23 : image_loaded_count_(0), |
| 23 quit_in_image_loaded_(false), | 24 quit_in_image_loaded_(false), |
| 24 ui_thread_(ChromeThread::UI, &ui_loop_), | 25 ui_thread_(ChromeThread::UI, &ui_loop_), |
| 25 file_thread_(ChromeThread::FILE), | 26 file_thread_(ChromeThread::FILE), |
| 26 io_thread_(ChromeThread::IO) { | 27 io_thread_(ChromeThread::IO) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 171 |
| 171 WaitForImageLoad(); | 172 WaitForImageLoad(); |
| 172 | 173 |
| 173 // Even though we deleted the extension, we should still get the image. | 174 // Even though we deleted the extension, we should still get the image. |
| 174 // We should still have gotten the image. | 175 // We should still have gotten the image. |
| 175 EXPECT_EQ(1, image_loaded_count()); | 176 EXPECT_EQ(1, image_loaded_count()); |
| 176 | 177 |
| 177 // Check that the image was loaded. | 178 // Check that the image was loaded. |
| 178 EXPECT_EQ(Extension::EXTENSION_ICON_SMALLISH, image_.width()); | 179 EXPECT_EQ(Extension::EXTENSION_ICON_SMALLISH, image_.width()); |
| 179 } | 180 } |
| OLD | NEW |