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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp

Issue 2054643003: Remove duplication of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: m_image should not be cleared Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 ASSERT_TRUE(cachedImage->hasImage()); 282 ASSERT_TRUE(cachedImage->hasImage());
283 ASSERT_FALSE(cachedImage->getImage()->isNull()); 283 ASSERT_FALSE(cachedImage->getImage()->isNull());
284 ASSERT_EQ(client->imageChangedCount(), 2); 284 ASSERT_EQ(client->imageChangedCount(), 2);
285 ASSERT_TRUE(client->notifyFinishedCalled()); 285 ASSERT_TRUE(client->notifyFinishedCalled());
286 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage()); 286 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage());
287 287
288 cachedImage->reloadIfLoFi(fetcher); 288 cachedImage->reloadIfLoFi(fetcher);
289 ASSERT_FALSE(cachedImage->errorOccurred()); 289 ASSERT_FALSE(cachedImage->errorOccurred());
290 ASSERT_FALSE(cachedImage->resourceBuffer()); 290 ASSERT_FALSE(cachedImage->resourceBuffer());
291 ASSERT_TRUE(cachedImage->hasImage()); 291 ASSERT_TRUE(cachedImage->hasImage());
292 ASSERT_EQ(client->imageChangedCount(), 3); 292 ASSERT_EQ(client->imageChangedCount(), 2);
293 293
294 cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(r esourceResponse), nullptr); 294 cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(r esourceResponse), nullptr);
295 cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*> (jpeg.data()), jpeg.size(), jpeg.size()); 295 cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*> (jpeg.data()), jpeg.size(), jpeg.size());
296 cachedImage->loader()->didFinishLoading(nullptr, 0.0, jpeg.size()); 296 cachedImage->loader()->didFinishLoading(nullptr, 0.0, jpeg.size());
297 ASSERT_FALSE(cachedImage->errorOccurred()); 297 ASSERT_FALSE(cachedImage->errorOccurred());
298 ASSERT_TRUE(cachedImage->hasImage()); 298 ASSERT_TRUE(cachedImage->hasImage());
299 ASSERT_FALSE(cachedImage->getImage()->isNull()); 299 ASSERT_FALSE(cachedImage->getImage()->isNull());
300 ASSERT_TRUE(client->notifyFinishedCalled()); 300 ASSERT_TRUE(client->notifyFinishedCalled());
301 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage()); 301 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage());
302 } 302 }
303 303
304 } // namespace blink 304 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698