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

Side by Side Diff: chrome/browser/cocoa/nsimage_cache_unittest.mm

Issue 243100: Move nsimage_cache into base so that it can be accessed from outside of chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/nsimage_cache.mm ('k') | chrome/browser/cocoa/tab_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/mac_util.h" 8 #include "base/mac_util.h"
9 #include "base/nsimage_cache_mac.h"
9 #include "base/path_service.h" 10 #include "base/path_service.h"
10 #include "chrome/browser/cocoa/nsimage_cache.h"
11 #include "chrome/common/mac_app_names.h" 11 #include "chrome/common/mac_app_names.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "testing/platform_test.h" 13 #include "testing/platform_test.h"
14 14
15 // This tests nsimage_cache, which lives in base/. The unit test is in
16 // chrome/ because it depends on having a built-up Chrome present.
17
15 namespace { 18 namespace {
16 19
17 class NSImageCacheTest : public PlatformTest { 20 class NSImageCacheTest : public PlatformTest {
18 public: 21 public:
19 NSImageCacheTest() { 22 NSImageCacheTest() {
20 // Look in the Chromium app bundle for resources. 23 // Look in the Chromium app bundle for resources.
21 FilePath path; 24 FilePath path;
22 PathService::Get(base::DIR_EXE, &path); 25 PathService::Get(base::DIR_EXE, &path);
23 path = path.AppendASCII(MAC_BROWSER_APP_NAME); 26 path = path.AppendASCII(MAC_BROWSER_APP_NAME);
24 mac_util::SetOverrideAppBundlePath(path); 27 mac_util::SetOverrideAppBundlePath(path);
(...skipping 22 matching lines...) Expand all
47 TEST_F(NSImageCacheTest, LookupFoundAndClear) { 50 TEST_F(NSImageCacheTest, LookupFoundAndClear) {
48 NSImage *first = nsimage_cache::ImageNamed(@"back_Template.pdf"); 51 NSImage *first = nsimage_cache::ImageNamed(@"back_Template.pdf");
49 EXPECT_TRUE(first != nil) 52 EXPECT_TRUE(first != nil)
50 << "Failed to find the toolbar image?"; 53 << "Failed to find the toolbar image?";
51 nsimage_cache::Clear(); 54 nsimage_cache::Clear();
52 EXPECT_NE(first, nsimage_cache::ImageNamed(@"back_Template.pdf")) 55 EXPECT_NE(first, nsimage_cache::ImageNamed(@"back_Template.pdf"))
53 << "how'd we get the same image after a cache clear?"; 56 << "how'd we get the same image after a cache clear?";
54 } 57 }
55 58
56 } // namespace 59 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/nsimage_cache.mm ('k') | chrome/browser/cocoa/tab_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698