summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/image_loading_tracker_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/image_loading_tracker_unittest.cc')
-rw-r--r--chrome/browser/extensions/image_loading_tracker_unittest.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome/browser/extensions/image_loading_tracker_unittest.cc b/chrome/browser/extensions/image_loading_tracker_unittest.cc
index f796a36..57b5268 100644
--- a/chrome/browser/extensions/image_loading_tracker_unittest.cc
+++ b/chrome/browser/extensions/image_loading_tracker_unittest.cc
@@ -51,7 +51,7 @@ class ImageLoadingTrackerTest : public testing::Test,
return result;
}
- Extension* CreateExtension() {
+ scoped_refptr<Extension> CreateExtension() {
// Create and load an extension.
FilePath test_file;
if (!PathService::Get(chrome::DIR_TEST_DATA, &test_file)) {
@@ -74,11 +74,8 @@ class ImageLoadingTrackerTest : public testing::Test,
if (!valid_value.get())
return NULL;
- scoped_ptr<Extension> extension(new Extension(test_file));
- if (!extension->InitFromValue(*valid_value, false, &error))
- return NULL;
-
- return extension.release();
+ return Extension::Create(
+ test_file, Extension::INVALID, *valid_value, false, &error);
}
SkBitmap image_;
@@ -99,7 +96,7 @@ class ImageLoadingTrackerTest : public testing::Test,
// Tests asking ImageLoadingTracker to cache pushes the result to the Extension.
TEST_F(ImageLoadingTrackerTest, Cache) {
- scoped_ptr<Extension> extension(CreateExtension());
+ scoped_refptr<Extension> extension(CreateExtension());
ASSERT_TRUE(extension.get() != NULL);
ExtensionResource image_resource =
@@ -146,7 +143,7 @@ TEST_F(ImageLoadingTrackerTest, Cache) {
// Tests deleting an extension while waiting for the image to load doesn't cause
// problems.
TEST_F(ImageLoadingTrackerTest, DeleteExtensionWhileWaitingForCache) {
- scoped_ptr<Extension> extension(CreateExtension());
+ scoped_refptr<Extension> extension(CreateExtension());
ASSERT_TRUE(extension.get() != NULL);
ExtensionResource image_resource =
@@ -166,11 +163,11 @@ TEST_F(ImageLoadingTrackerTest, DeleteExtensionWhileWaitingForCache) {
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources(),
- Details<Extension>(extension.get()));
+ Details<const Extension>(extension.get()));
// Chuck the extension, that way if anyone tries to access it we should crash
// or get valgrind errors.
- extension.reset();
+ extension = NULL;
WaitForImageLoad();