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

Side by Side Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp

Issue 2683033005: URLLoaderMockFactory: clear MemoryCache in unregisterAllURLs (Closed)
Patch Set: fix Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/ThreadableLoader.h" 5 #include "core/loader/ThreadableLoader.h"
6 6
7 #include "core/dom/ExecutionContextTask.h" 7 #include "core/dom/ExecutionContextTask.h"
8 #include "core/loader/DocumentThreadableLoader.h" 8 #include "core/loader/DocumentThreadableLoader.h"
9 #include "core/loader/ThreadableLoaderClient.h" 9 #include "core/loader/ThreadableLoaderClient.h"
10 #include "core/loader/WorkerThreadableLoader.h" 10 #include "core/loader/WorkerThreadableLoader.h"
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 setUpErrorURL(); 399 setUpErrorURL();
400 setUpRedirectURL(); 400 setUpRedirectURL();
401 setUpRedirectLoopURL(); 401 setUpRedirectLoopURL();
402 402
403 m_client = MockThreadableLoaderClient::create(); 403 m_client = MockThreadableLoaderClient::create();
404 m_helper->onSetUp(); 404 m_helper->onSetUp();
405 } 405 }
406 406
407 void TearDown() override { 407 void TearDown() override {
408 m_helper->onTearDown(); 408 m_helper->onTearDown();
409 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 409 Platform::current()
410 memoryCache()->evictResources(); 410 ->getURLLoaderMockFactory()
411 ->unregisterAllURLsAndClearMemoryCache();
411 m_client.reset(); 412 m_client.reset();
412 } 413 }
413 414
414 void setUpSuccessURL() { 415 void setUpSuccessURL() {
415 URLTestHelpers::registerMockedURLLoad( 416 URLTestHelpers::registerMockedURLLoad(
416 successURL(), testing::webTestDataPath(kFileName), "text/html"); 417 successURL(), testing::webTestDataPath(kFileName), "text/html");
417 } 418 }
418 419
419 void setUpErrorURL() { 420 void setUpErrorURL() {
420 URLTestHelpers::registerMockedErrorURLLoad(errorURL()); 421 URLTestHelpers::registerMockedErrorURLLoad(errorURL());
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 // test is not saying that didFailAccessControlCheck should be dispatched 883 // test is not saying that didFailAccessControlCheck should be dispatched
883 // synchronously, but is saying that even when a response is served 884 // synchronously, but is saying that even when a response is served
884 // synchronously it should not lead to a crash. 885 // synchronously it should not lead to a crash.
885 startLoader(KURL(KURL(), "about:blank")); 886 startLoader(KURL(KURL(), "about:blank"));
886 callCheckpoint(2); 887 callCheckpoint(2);
887 } 888 }
888 889
889 } // namespace 890 } // namespace
890 891
891 } // namespace blink 892 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698