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

Unified Diff: content/test/weburl_loader_mock_factory.cc

Issue 1310153003: Change WebURLLoaderMockFactory for future FOUC tests in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments + default Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/weburl_loader_mock_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/weburl_loader_mock_factory.cc
diff --git a/content/test/weburl_loader_mock_factory.cc b/content/test/weburl_loader_mock_factory.cc
index 64bdea1b8824afe31a2e7a9dd135247dd2b66ade..1651800902696f39314a2dbd40b1782dc5a445a7 100644
--- a/content/test/weburl_loader_mock_factory.cc
+++ b/content/test/weburl_loader_mock_factory.cc
@@ -108,9 +108,7 @@ bool WebURLLoaderMockFactory::IsMockedURL(const blink::WebURL& url) {
}
void WebURLLoaderMockFactory::CancelLoad(WebURLLoaderMock* loader) {
- LoaderToRequestMap::iterator iter = pending_loaders_.find(loader);
- DCHECK(iter != pending_loaders_.end());
- pending_loaders_.erase(iter);
+ pending_loaders_.erase(loader);
}
WebURLLoader* WebURLLoaderMockFactory::CreateURLLoader(
@@ -166,6 +164,11 @@ bool WebURLLoaderMockFactory::IsPending(WebURLLoaderMock* loader) {
// static
bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path,
WebData* data) {
+ // If the path is empty then we return an empty file so tests can simulate
+ // requests without needing to actually load files.
+ if (file_path.empty())
+ return true;
+
int64 file_size = 0;
if (!base::GetFileSize(file_path, &file_size))
return false;
« no previous file with comments | « content/test/weburl_loader_mock_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698