summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/image_loading_tracker_unittest.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-18 18:32:45 +0000
committerBen Murdoch <benm@google.com>2010-11-18 18:38:07 +0000
commit513209b27ff55e2841eac0e4120199c23acce758 (patch)
treeaeba30bb08c5f47c57003544e378a377c297eee6 /chrome/browser/extensions/image_loading_tracker_unittest.cc
parent164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff)
downloadexternal_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
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();