Commit 20187ac5 authored by sdefresne's avatar sdefresne Committed by Commit bot

[iOS] Fix ios_chrome_unittests on iPad

-[SnapshotCache handleLowMemory] DCHECK on iPad so do not call the method
if IsIPadIdiom() returns YES.

BUG=None

Review URL: https://codereview.chromium.org/1148873002

Cr-Commit-Position: refs/heads/master@{#330747}
parent 31af4784
...@@ -377,6 +377,7 @@ TEST_F(SnapshotCacheTest, HandleLowMemory) { ...@@ -377,6 +377,7 @@ TEST_F(SnapshotCacheTest, HandleLowMemory) {
[set addObject:secondPinnedID]; [set addObject:secondPinnedID];
cache.pinnedIDs = set; cache.pinnedIDs = set;
if (!IsIPadIdiom())
[cache handleLowMemory]; [cache handleLowMemory];
BOOL expectedValue = YES; BOOL expectedValue = YES;
...@@ -430,6 +431,8 @@ TEST_F(SnapshotCacheTest, CreateGreyCacheFromDisk) { ...@@ -430,6 +431,8 @@ TEST_F(SnapshotCacheTest, CreateGreyCacheFromDisk) {
// Remove color images from in-memory cache. // Remove color images from in-memory cache.
SnapshotCache* cache = GetSnapshotCache(); SnapshotCache* cache = GetSnapshotCache();
if (!IsIPadIdiom())
[cache handleLowMemory]; [cache handleLowMemory];
// Request the creation of a grey image cache for all images. // Request the creation of a grey image cache for all images.
...@@ -471,6 +474,7 @@ TEST_F(SnapshotCacheTest, MostRecentGreyBlock) { ...@@ -471,6 +474,7 @@ TEST_F(SnapshotCacheTest, MostRecentGreyBlock) {
LoadColorImagesIntoCache(kNumImages, true); LoadColorImagesIntoCache(kNumImages, true);
// Make sure the color images are only on disk, to ensure the background // Make sure the color images are only on disk, to ensure the background
// thread is slow enough to queue up the requests. // thread is slow enough to queue up the requests.
if (!IsIPadIdiom())
[cache handleLowMemory]; [cache handleLowMemory];
// Enable the grey image cache. // Enable the grey image cache.
...@@ -542,6 +546,7 @@ TEST_F(SnapshotCacheTest, SizeAndScalePreservation) { ...@@ -542,6 +546,7 @@ TEST_F(SnapshotCacheTest, SizeAndScalePreservation) {
NSString* const kSession = @"foo"; NSString* const kSession = @"foo";
[cache setImage:image withSessionID:kSession]; [cache setImage:image withSessionID:kSession];
FlushRunLoops(); // ensure the file is written to disk. FlushRunLoops(); // ensure the file is written to disk.
if (!IsIPadIdiom())
[cache handleLowMemory]; [cache handleLowMemory];
// Retrive the image and have the callback verify the size and scale. // Retrive the image and have the callback verify the size and scale.
...@@ -578,6 +583,7 @@ TEST_F(SnapshotCacheTest, DeleteRetinaImages) { ...@@ -578,6 +583,7 @@ TEST_F(SnapshotCacheTest, DeleteRetinaImages) {
NSString* const kSession = @"foo"; NSString* const kSession = @"foo";
[cache setImage:image withSessionID:kSession]; [cache setImage:image withSessionID:kSession];
FlushRunLoops(); // ensure the file is written to disk. FlushRunLoops(); // ensure the file is written to disk.
if (!IsIPadIdiom())
[cache handleLowMemory]; [cache handleLowMemory];
// Verify the file was writted with @2x in the file name. // Verify the file was writted with @2x in the file name.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment