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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 1840933002: Do not rely on broken images in http/tests/multipart/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 bool Internals::isPreloaded(const String& url) { 400 bool Internals::isPreloaded(const String& url) {
401 return isPreloadedBy(url, contextDocument()); 401 return isPreloadedBy(url, contextDocument());
402 } 402 }
403 403
404 bool Internals::isPreloadedBy(const String& url, Document* document) { 404 bool Internals::isPreloadedBy(const String& url, Document* document) {
405 if (!document) 405 if (!document)
406 return false; 406 return false;
407 return document->fetcher()->isPreloadedForTest(document->completeURL(url)); 407 return document->fetcher()->isPreloadedForTest(document->completeURL(url));
408 } 408 }
409 409
410 bool Internals::isLoading(const String& url) {
411 if (!contextDocument())
412 return false;
413 const String cacheIdentifier =
414 contextDocument()->fetcher()->getCacheIdentifier();
415 Resource* resource = memoryCache()->resourceForURL(
416 contextDocument()->completeURL(url), cacheIdentifier);
417 // We check loader() here instead of isLoading(), because a multipart
418 // ImageResource lies isLoading() == false after the first part is loaded.
419 return resource && resource->loader();
420 }
421
410 bool Internals::isLoadingFromMemoryCache(const String& url) { 422 bool Internals::isLoadingFromMemoryCache(const String& url) {
411 if (!contextDocument()) 423 if (!contextDocument())
412 return false; 424 return false;
413 const String cacheIdentifier = 425 const String cacheIdentifier =
414 contextDocument()->fetcher()->getCacheIdentifier(); 426 contextDocument()->fetcher()->getCacheIdentifier();
415 Resource* resource = memoryCache()->resourceForURL( 427 Resource* resource = memoryCache()->resourceForURL(
416 contextDocument()->completeURL(url), cacheIdentifier); 428 contextDocument()->completeURL(url), cacheIdentifier);
417 return resource && resource->getStatus() == Resource::Cached; 429 return resource && resource->getStatus() == Resource::Cached;
418 } 430 }
419 431
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after
3082 return ClientRect::create(); 3094 return ClientRect::create();
3083 3095
3084 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); 3096 return ClientRect::create(FloatRect(node->layoutObject()->visualRect()));
3085 } 3097 }
3086 3098
3087 void Internals::crash() { 3099 void Internals::crash() {
3088 CHECK(false) << "Intentional crash"; 3100 CHECK(false) << "Intentional crash";
3089 } 3101 }
3090 3102
3091 } // namespace blink 3103 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698