OLD | NEW |
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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 EXPECT_EQ(1, cachedImage->getImage()->height()); | 360 EXPECT_EQ(1, cachedImage->getImage()->height()); |
361 | 361 |
362 cachedImage->reloadIfLoFi(fetcher); | 362 cachedImage->reloadIfLoFi(fetcher); |
363 ASSERT_FALSE(cachedImage->errorOccurred()); | 363 ASSERT_FALSE(cachedImage->errorOccurred()); |
364 ASSERT_FALSE(cachedImage->resourceBuffer()); | 364 ASSERT_FALSE(cachedImage->resourceBuffer()); |
365 ASSERT_FALSE(cachedImage->hasImage()); | 365 ASSERT_FALSE(cachedImage->hasImage()); |
366 ASSERT_EQ(client->imageChangedCount(), 3); | 366 ASSERT_EQ(client->imageChangedCount(), 3); |
367 | 367 |
368 Vector<unsigned char> jpeg2 = jpegImage2(); | 368 Vector<unsigned char> jpeg2 = jpegImage2(); |
369 cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(r
esourceResponse), nullptr); | 369 cachedImage->loader()->didReceiveResponse(nullptr, WrappedResourceResponse(r
esourceResponse), nullptr); |
370 cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>
(jpeg2.data()), jpeg2.size(), jpeg2.size()); | 370 cachedImage->loader()->didReceiveData(nullptr, reinterpret_cast<const char*>
(jpeg2.data()), jpeg2.size(), jpeg2.size(), jpeg2.size()); |
371 cachedImage->loader()->didFinishLoading(nullptr, 0.0, jpeg2.size()); | 371 cachedImage->loader()->didFinishLoading(nullptr, 0.0, jpeg2.size()); |
372 ASSERT_FALSE(cachedImage->errorOccurred()); | 372 ASSERT_FALSE(cachedImage->errorOccurred()); |
373 ASSERT_TRUE(cachedImage->hasImage()); | 373 ASSERT_TRUE(cachedImage->hasImage()); |
374 ASSERT_FALSE(cachedImage->getImage()->isNull()); | 374 ASSERT_FALSE(cachedImage->getImage()->isNull()); |
375 ASSERT_TRUE(client->notifyFinishedCalled()); | 375 ASSERT_TRUE(client->notifyFinishedCalled()); |
376 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage()); | 376 ASSERT_TRUE(cachedImage->getImage()->isBitmapImage()); |
377 EXPECT_EQ(50, cachedImage->getImage()->width()); | 377 EXPECT_EQ(50, cachedImage->getImage()->width()); |
378 EXPECT_EQ(50, cachedImage->getImage()->height()); | 378 EXPECT_EQ(50, cachedImage->getImage()->height()); |
379 } | 379 } |
380 | 380 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 Persistent<MockResourceClient> client2 = new MockResourceClient(imageResourc
e); | 612 Persistent<MockResourceClient> client2 = new MockResourceClient(imageResourc
e); |
613 | 613 |
614 ASSERT_TRUE(imageResource->hasImage()); | 614 ASSERT_TRUE(imageResource->hasImage()); |
615 EXPECT_FALSE(imageResource->getImage()->isNull()); | 615 EXPECT_FALSE(imageResource->getImage()->isNull()); |
616 EXPECT_EQ(1, imageResource->getImage()->width()); | 616 EXPECT_EQ(1, imageResource->getImage()->width()); |
617 EXPECT_EQ(1, imageResource->getImage()->height()); | 617 EXPECT_EQ(1, imageResource->getImage()->height()); |
618 EXPECT_TRUE(client2->notifyFinishedCalled()); | 618 EXPECT_TRUE(client2->notifyFinishedCalled()); |
619 } | 619 } |
620 | 620 |
621 } // namespace blink | 621 } // namespace blink |
OLD | NEW |