Index: ios/chrome/browser/snapshots/snapshot_cache_unittest.mm |
diff --git a/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm b/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm |
index ef3145d505995afe4aa74d6ca81610742849d458..886b945d167885c0e65b195a2f40db2a58bbbbfe 100644 |
--- a/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm |
+++ b/ios/chrome/browser/snapshots/snapshot_cache_unittest.mm |
@@ -9,7 +9,6 @@ |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
#include "base/format_macros.h" |
-#include "base/ios/ios_util.h" |
#include "base/location.h" |
#include "base/mac/bind_objc_block.h" |
#include "base/mac/scoped_nsautorelease_pool.h" |
@@ -31,6 +30,8 @@ static const NSUInteger kSnapshotPixelSize = 8; |
@interface SnapshotCache (Testing) |
+ (base::FilePath)imagePathForSessionID:(NSString*)sessionID; |
+ (base::FilePath)greyImagePathForSessionID:(NSString*)sessionID; |
+- (BOOL)cacheIsEnabled; |
+- (BOOL)useLRUCache; |
- (void)handleLowMemory; |
@end |
@@ -223,7 +224,7 @@ TEST_F(SnapshotCacheTest, Cache) { |
SnapshotCache* cache = GetSnapshotCache(); |
NSUInteger expectedCacheSize = kSessionCount; |
- if (experimental_flags::IsLRUSnapshotCacheEnabled()) |
+ if ([cache useLRUCache]) |
expectedCacheSize = MIN(kSessionCount, [cache lruCacheMaxSize]); |
// Put all images in the cache. |
@@ -349,14 +350,6 @@ TEST_F(SnapshotCacheTest, Purge) { |
// Loads the color images into the cache, and pins two of them. Ensures that |
// only the two pinned IDs remain in memory after a call to -handleLowMemory. |
TEST_F(SnapshotCacheTest, HandleLowMemory) { |
-// TODO(droger): This test fails on iPad iOS8 device: http://crbug.com/455209 |
-#if !TARGET_IPHONE_SIMULATOR |
- if (IsIPadIdiom() && base::ios::IsRunningOnIOS8OrLater()) { |
- LOG(WARNING) << "Test disabled on iPad iOS8 device."; |
- return; |
- } |
-#endif |
- |
LoadAllColorImagesIntoCache(true); |
SnapshotCache* cache = GetSnapshotCache(); |
@@ -367,16 +360,10 @@ TEST_F(SnapshotCacheTest, HandleLowMemory) { |
[set addObject:firstPinnedID]; |
[set addObject:secondPinnedID]; |
cache.pinnedIDs = set; |
+ [cache handleLowMemory]; |
- if (!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()) |
- [cache handleLowMemory]; |
- |
- BOOL expectedValue = YES; |
- if (IsIPadIdiom() && !experimental_flags::IsTabSwitcherEnabled()) |
- expectedValue = NO; |
- |
- EXPECT_EQ(expectedValue, [cache hasImageInMemory:firstPinnedID]); |
- EXPECT_EQ(expectedValue, [cache hasImageInMemory:secondPinnedID]); |
+ EXPECT_EQ(YES, [cache hasImageInMemory:firstPinnedID]); |
+ EXPECT_EQ(YES, [cache hasImageInMemory:secondPinnedID]); |
NSString* notPinnedID = [testSessions_ objectAtIndex:2]; |
EXPECT_FALSE([cache hasImageInMemory:notPinnedID]); |