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

Side by Side Diff: third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp

Issue 2165573003: Simplify tests by using Web*Impl types directly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "platform/testing/URLTestHelpers.h" 5 #include "platform/testing/URLTestHelpers.h"
6 #include "public/platform/Platform.h" 6 #include "public/platform/Platform.h"
7 #include "public/platform/WebURLLoaderClient.h" 7 #include "public/platform/WebURLLoaderClient.h"
8 #include "public/platform/WebURLLoaderMockFactory.h" 8 #include "public/platform/WebURLLoaderMockFactory.h"
9 #include "public/web/WebCache.h" 9 #include "public/web/WebCache.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 void TearDown() override 29 void TearDown() override
30 { 30 {
31 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); 31 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
32 WebCache::clear(); 32 WebCache::clear();
33 } 33 }
34 34
35 WebLocalFrameImpl* mainFrame() 35 WebLocalFrameImpl* mainFrame()
36 { 36 {
37 return m_webViewHelper.webViewImpl()->mainFrameImpl(); 37 return m_webViewHelper.webView()->mainFrameImpl();
38 } 38 }
39 39
40 FrameTestHelpers::WebViewHelper m_webViewHelper; 40 FrameTestHelpers::WebViewHelper m_webViewHelper;
41 }; 41 };
42 42
43 TEST_F(DocumentLoaderTest, SingleChunk) 43 TEST_F(DocumentLoaderTest, SingleChunk)
44 { 44 {
45 class TestDelegate : public WebURLLoaderTestDelegate { 45 class TestDelegate : public WebURLLoaderTestDelegate {
46 public: 46 public:
47 void didReceiveData(WebURLLoaderClient* originalClient, WebURLLoader* lo ader, const char* data, int dataLength, int encodedDataLength) override 47 void didReceiveData(WebURLLoaderClient* originalClient, WebURLLoader* lo ader, const char* data, int dataLength, int encodedDataLength) override
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr); 161 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(nullptr);
162 162
163 EXPECT_TRUE(delegate.servedReentrantly()); 163 EXPECT_TRUE(delegate.servedReentrantly());
164 164
165 // delegate is a WebFrameClient and stack-allocated, so manually reset() the 165 // delegate is a WebFrameClient and stack-allocated, so manually reset() the
166 // WebViewHelper here. 166 // WebViewHelper here.
167 m_webViewHelper.reset(); 167 m_webViewHelper.reset();
168 } 168 }
169 169
170 } // namespace blink 170 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698