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

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

Issue 1035803002: Remove ResourceFetcher's access to a real FetchContext at frame detach time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved ASSERT(!m_importsController) to #if !ENABLE(OILPAN) block Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/FetchContext.cpp ('k') | Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 ASSERT_EQ(cachedImage->image()->height(), 1); 124 ASSERT_EQ(cachedImage->image()->height(), 1);
125 ASSERT_EQ(client.imageChangedCount(), 2); 125 ASSERT_EQ(client.imageChangedCount(), 2);
126 ASSERT_TRUE(client.notifyFinishedCalled()); 126 ASSERT_TRUE(client.notifyFinishedCalled());
127 } 127 }
128 128
129 TEST(ImageResourceTest, CancelOnDetach) 129 TEST(ImageResourceTest, CancelOnDetach)
130 { 130 {
131 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html"); 131 KURL testURL(ParsedURLString, "http://www.test.com/cancelTest.html");
132 URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html", "text/html "); 132 URLTestHelpers::registerMockedURLLoad(testURL, "cancelTest.html", "text/html ");
133 133
134 RefPtrWillBeRawPtr<ResourceFetcher> fetcher = ResourceFetcher::create(FetchC ontext::create()); 134 RefPtrWillBeRawPtr<ResourceFetcher> fetcher = ResourceFetcher::create(nullpt r);
135 135
136 // Emulate starting a real load. 136 // Emulate starting a real load.
137 ResourcePtr<ImageResource> cachedImage = new ImageResource(ResourceRequest(t estURL)); 137 ResourcePtr<ImageResource> cachedImage = new ImageResource(ResourceRequest(t estURL));
138 cachedImage->setIdentifier(createUniqueIdentifier()); 138 cachedImage->setIdentifier(createUniqueIdentifier());
139 139
140 cachedImage->load(fetcher.get(), ResourceLoaderOptions()); 140 cachedImage->load(fetcher.get(), ResourceLoaderOptions());
141 memoryCache()->add(cachedImage.get()); 141 memoryCache()->add(cachedImage.get());
142 142
143 MockImageResourceClient client; 143 MockImageResourceClient client;
144 cachedImage->addClient(&client); 144 cachedImage->addClient(&client);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 ASSERT_FALSE(cachedImage->image()->isNull()); 211 ASSERT_FALSE(cachedImage->image()->isNull());
212 ASSERT_EQ(client.imageChangedCount(), 1); 212 ASSERT_EQ(client.imageChangedCount(), 1);
213 ASSERT_TRUE(client.notifyFinishedCalled()); 213 ASSERT_TRUE(client.notifyFinishedCalled());
214 214
215 HashSet<ImageResource*> bitmapImages; 215 HashSet<ImageResource*> bitmapImages;
216 ASSERT_TRUE(cachedImage->image()->isBitmapImage()); 216 ASSERT_TRUE(cachedImage->image()->isBitmapImage());
217 bitmapImages.add(cachedImage.get()); 217 bitmapImages.add(cachedImage.get());
218 } 218 }
219 219
220 } // namespace 220 } // namespace
OLDNEW
« no previous file with comments | « Source/core/fetch/FetchContext.cpp ('k') | Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698