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

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

Issue 2036403002: Always use the WebFrameWidget when attaching the root graphics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding comments 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 TemporaryChange<bool> dispatching(m_dispatchingDidReceiveData, t rue); 111 TemporaryChange<bool> dispatching(m_dispatchingDidReceiveData, t rue);
112 dispatchOneByte(); 112 dispatchOneByte();
113 } 113 }
114 // Serve the remaining bytes to complete the load. 114 // Serve the remaining bytes to complete the load.
115 EXPECT_FALSE(m_data.empty()); 115 EXPECT_FALSE(m_data.empty());
116 while (!m_data.empty()) 116 while (!m_data.empty())
117 dispatchOneByte(); 117 dispatchOneByte();
118 } 118 }
119 119
120 // WebFrameClient overrides: 120 // WebFrameClient overrides:
121 void frameDetached(WebFrame* frame, DetachType detachType) override 121 void frameDetached(WebLocalFrame* frame, DetachType detachType) override
122 { 122 {
123 if (m_dispatchingDidReceiveData) { 123 if (m_dispatchingDidReceiveData) {
124 // This should be called by the first didReceiveData() call, sin ce 124 // This should be called by the first didReceiveData() call, sin ce
125 // it should commit the provisional load. 125 // it should commit the provisional load.
126 EXPECT_GT(m_data.size(), 10u); 126 EXPECT_GT(m_data.size(), 10u);
127 // Dispatch dataReceived() callbacks for part of the remaining 127 // Dispatch dataReceived() callbacks for part of the remaining
128 // data, saving the rest to be dispatched at the top-level as 128 // data, saving the rest to be dispatched at the top-level as
129 // normal. 129 // normal.
130 while (m_data.size() > 10) 130 while (m_data.size() > 10)
131 dispatchOneByte(); 131 dispatchOneByte();
(...skipping 29 matching lines...) Expand all
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