Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3717)

Unified Diff: chrome/browser/ui/cocoa/nsimage_cache_unittest.mm

Issue 5961007: Move nsimage_cache from base to app/mac. Use the app::mac namespace. Update c... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/nsimage_cache_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/nsimage_cache_unittest.mm (revision 69953)
+++ chrome/browser/ui/cocoa/nsimage_cache_unittest.mm (working copy)
@@ -1,12 +1,12 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
+#include "app/mac/nsimage_cache.h"
#include "base/file_path.h"
#include "base/mac_util.h"
-#include "base/nsimage_cache_mac.h"
#include "base/path_service.h"
#include "chrome/common/chrome_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,30 +32,30 @@
};
TEST_F(NSImageCacheTest, LookupFound) {
- EXPECT_TRUE(nsimage_cache::ImageNamed(@"back_Template.pdf") != nil)
+ EXPECT_TRUE(app::mac::GetCachedImageWithName(@"back_Template.pdf") != nil)
<< "Failed to find the toolbar image?";
}
TEST_F(NSImageCacheTest, LookupCached) {
- EXPECT_EQ(nsimage_cache::ImageNamed(@"back_Template.pdf"),
- nsimage_cache::ImageNamed(@"back_Template.pdf"))
+ EXPECT_EQ(app::mac::GetCachedImageWithName(@"back_Template.pdf"),
+ app::mac::GetCachedImageWithName(@"back_Template.pdf"))
<< "Didn't get the same NSImage back?";
}
TEST_F(NSImageCacheTest, LookupMiss) {
- EXPECT_TRUE(nsimage_cache::ImageNamed(@"should_not.exist") == nil)
+ EXPECT_TRUE(app::mac::GetCachedImageWithName(@"should_not.exist") == nil)
<< "There shouldn't be an image with this name?";
}
TEST_F(NSImageCacheTest, LookupFoundAndClear) {
- NSImage *first = nsimage_cache::ImageNamed(@"back_Template.pdf");
+ NSImage *first = app::mac::GetCachedImageWithName(@"back_Template.pdf");
// Hang on to the first image so that the second one doesn't get allocated
// in the same location by (bad) luck.
[[first retain] autorelease];
EXPECT_TRUE(first != nil)
<< "Failed to find the toolbar image?";
- nsimage_cache::Clear();
- NSImage *second = nsimage_cache::ImageNamed(@"back_Template.pdf");
+ app::mac::ClearCachedImages();
+ NSImage *second = app::mac::GetCachedImageWithName(@"back_Template.pdf");
EXPECT_TRUE(second != nil)
<< "Failed to find the toolbar image...again?";
EXPECT_NE(second, first)
@@ -63,10 +63,12 @@
}
TEST_F(NSImageCacheTest, AutoTemplating) {
- NSImage *templateImage = nsimage_cache::ImageNamed(@"back_Template.pdf");
+ NSImage *templateImage =
+ app::mac::GetCachedImageWithName(@"back_Template.pdf");
EXPECT_TRUE([templateImage isTemplate] == YES)
<< "Image ending in 'Template' should be marked as being a template";
- NSImage *nonTemplateImage = nsimage_cache::ImageNamed(@"aliasCursor.png");
+ NSImage *nonTemplateImage =
+ app::mac::GetCachedImageWithName(@"aliasCursor.png");
EXPECT_FALSE([nonTemplateImage isTemplate] == YES)
<< "Image not ending in 'Template' should not be marked as being a "
"template";
« no previous file with comments | « chrome/browser/ui/cocoa/notifications/balloon_controller.mm ('k') | chrome/browser/ui/cocoa/reload_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698