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

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: 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 | « no previous file | 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..b6fd18a88c3bb4b946b423af578599e45a28d4f0 100644
--- a/content/test/weburl_loader_mock_factory.cc
+++ b/content/test/weburl_loader_mock_factory.cc
@@ -109,7 +109,8 @@ bool WebURLLoaderMockFactory::IsMockedURL(const blink::WebURL& url) {
void WebURLLoaderMockFactory::CancelLoad(WebURLLoaderMock* loader) {
LoaderToRequestMap::iterator iter = pending_loaders_.find(loader);
dcheng 2015/08/26 15:38:18 How about just replacing the entire body with pend
esprehn 2015/08/26 16:01:40 Done.
- DCHECK(iter != pending_loaders_.end());
+ if (iter == pending_loaders_.end())
+ return;
pending_loaders_.erase(iter);
}
@@ -166,6 +167,9 @@ bool WebURLLoaderMockFactory::IsPending(WebURLLoaderMock* loader) {
// static
bool WebURLLoaderMockFactory::ReadFile(const base::FilePath& file_path,
WebData* data) {
+ if (file_path.empty())
+ return true;
+
int64 file_size = 0;
if (!base::GetFileSize(file_path, &file_size))
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698