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

Unified Diff: third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp

Issue 1845323002: Remove WebUnitTestSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp b/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp
index c10dfa03bba3f56ce7c9d991b305e371bea9b347..d360759b4d993bb766931322e7bec5130a5d2dca 100644
--- a/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp
+++ b/third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp
@@ -5,7 +5,8 @@
#include "platform/testing/URLTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebURLLoaderClient.h"
-#include "public/platform/WebUnitTestSupport.h"
+#include "public/platform/WebURLLoaderMockFactory.h"
+#include "public/web/WebCache.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "web/WebLocalFrameImpl.h"
#include "web/tests/FrameTestHelpers.h"
@@ -27,7 +28,8 @@ protected:
void TearDown() override
{
- Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
+ Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
+ WebCache::clear();
}
WebLocalFrameImpl* mainFrame()
@@ -49,9 +51,9 @@ TEST_F(DocumentLoaderTest, SingleChunk)
}
} delegate;
- Platform::current()->unitTestSupport()->setLoaderDelegate(&delegate);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate);
FrameTestHelpers::loadFrame(mainFrame(), "https://example.com/foo.html");
- Platform::current()->unitTestSupport()->setLoaderDelegate(nullptr);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr);
// TODO(dcheng): How should the test verify that the original callback is
// invoked? The test currently still passes even if the test delegate
@@ -73,9 +75,9 @@ TEST_F(DocumentLoaderTest, MultiChunkNoReentrancy)
}
} delegate;
- Platform::current()->unitTestSupport()->setLoaderDelegate(&delegate);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate);
FrameTestHelpers::loadFrame(mainFrame(), "https://example.com/foo.html");
- Platform::current()->unitTestSupport()->setLoaderDelegate(nullptr);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr);
}
// Finally, test reentrant callbacks to DocumentLoader::dataReceived().
@@ -154,9 +156,9 @@ TEST_F(DocumentLoaderTest, MultiChunkWithReentrancy)
// setup a situation where didReceiveData() can be invoked reentrantly.
FrameTestHelpers::loadHTMLString(mainFrame(), "<iframe></iframe>", URLTestHelpers::toKURL("about:blank"));
- Platform::current()->unitTestSupport()->setLoaderDelegate(&delegate);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate);
FrameTestHelpers::loadFrame(mainFrame(), "https://example.com/foo.html");
- Platform::current()->unitTestSupport()->setLoaderDelegate(nullptr);
+ Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr);
EXPECT_TRUE(delegate.servedReentrantly());

Powered by Google App Engine
This is Rietveld 408576698