summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/nsimage_cache_unittest.mm
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 03:25:48 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 03:25:48 +0000
commit9cb79c01841c4820fc35ab70cfc8daf61ee7405b (patch)
tree993c1b336dee95405f409eb762947aefe7525885 /chrome/browser/cocoa/nsimage_cache_unittest.mm
parentff8e86e13b5df6c717d5e1410be63c141be96799 (diff)
downloadchromium_src-9cb79c01841c4820fc35ab70cfc8daf61ee7405b.zip
chromium_src-9cb79c01841c4820fc35ab70cfc8daf61ee7405b.tar.gz
chromium_src-9cb79c01841c4820fc35ab70cfc8daf61ee7405b.tar.bz2
Reduce NSImageCacheTest.LookupFoundAndClear test flake
BUG=26176 TEST=watch this test on the bots tomorrow Review URL: http://codereview.chromium.org/344019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/nsimage_cache_unittest.mm')
-rw-r--r--chrome/browser/cocoa/nsimage_cache_unittest.mm11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/nsimage_cache_unittest.mm b/chrome/browser/cocoa/nsimage_cache_unittest.mm
index 1b8e42c..7f2e2fb 100644
--- a/chrome/browser/cocoa/nsimage_cache_unittest.mm
+++ b/chrome/browser/cocoa/nsimage_cache_unittest.mm
@@ -47,13 +47,18 @@ TEST_F(NSImageCacheTest, LookupMiss) {
<< "There shouldn't be an image with this name?";
}
-// This test is flaky. See bug 26176.
-TEST_F(NSImageCacheTest, FLAKY_LookupFoundAndClear) {
+TEST_F(NSImageCacheTest, LookupFoundAndClear) {
NSImage *first = nsimage_cache::ImageNamed(@"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();
- EXPECT_NE(first, nsimage_cache::ImageNamed(@"back_Template.pdf"))
+ NSImage *second = nsimage_cache::ImageNamed(@"back_Template.pdf");
+ EXPECT_TRUE(second != nil)
+ << "Failed to find the toolbar image...again?";
+ EXPECT_NE(second, first)
<< "how'd we get the same image after a cache clear?";
}