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

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

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ASSERT_FALSE(client.notifyFinishedCalled()); 128 ASSERT_FALSE(client.notifyFinishedCalled());
129 129
130 // This part finishes. The image is created, callbacks are sent, and the dat a buffer is cleared. 130 // This part finishes. The image is created, callbacks are sent, and the dat a buffer is cleared.
131 cachedImage->finish(); 131 cachedImage->finish();
132 ASSERT_FALSE(cachedImage->resourceBuffer()); 132 ASSERT_FALSE(cachedImage->resourceBuffer());
133 ASSERT_FALSE(cachedImage->errorOccurred()); 133 ASSERT_FALSE(cachedImage->errorOccurred());
134 ASSERT_TRUE(cachedImage->hasImage()); 134 ASSERT_TRUE(cachedImage->hasImage());
135 ASSERT_FALSE(cachedImage->image()->isNull()); 135 ASSERT_FALSE(cachedImage->image()->isNull());
136 ASSERT_EQ(cachedImage->image()->width(), 1); 136 ASSERT_EQ(cachedImage->image()->width(), 1);
137 ASSERT_EQ(cachedImage->image()->height(), 1); 137 ASSERT_EQ(cachedImage->image()->height(), 1);
138 ASSERT_EQ(client.imageChangedCount(), 2); 138 ASSERT_EQ(client.imageChangedCount(), 1);
139 ASSERT_TRUE(client.notifyFinishedCalled()); 139 ASSERT_TRUE(client.notifyFinishedCalled());
140 } 140 }
141 141
142 TEST(ImageResourceTest, CancelOnDetach) 142 TEST(ImageResourceTest, CancelOnDetach)
143 { 143 {
144 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html"); 144 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
145 URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html", "text/html "); 145 URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html", "text/html ");
146 146
147 ResourceFetcher* fetcher = ResourceFetcher::create(nullptr); 147 ResourceFetcher* fetcher = ResourceFetcher::create(nullptr);
148 148
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 cachedImage->finish(); 216 cachedImage->finish();
217 ASSERT_FALSE(cachedImage->errorOccurred()); 217 ASSERT_FALSE(cachedImage->errorOccurred());
218 ASSERT_TRUE(cachedImage->hasImage()); 218 ASSERT_TRUE(cachedImage->hasImage());
219 ASSERT_FALSE(cachedImage->image()->isNull()); 219 ASSERT_FALSE(cachedImage->image()->isNull());
220 ASSERT_EQ(client.imageChangedCount(), 2); 220 ASSERT_EQ(client.imageChangedCount(), 2);
221 ASSERT_TRUE(client.notifyFinishedCalled()); 221 ASSERT_TRUE(client.notifyFinishedCalled());
222 ASSERT_TRUE(cachedImage->image()->isBitmapImage()); 222 ASSERT_TRUE(cachedImage->image()->isBitmapImage());
223 } 223 }
224 224
225 } // namespace blink 225 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698