| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/loader/DocumentLoader.h" |
| 6 | 7 |
| 7 #include "platform/testing/URLTestHelpers.h" | 8 #include "platform/testing/URLTestHelpers.h" |
| 8 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 9 #include "public/platform/WebURLLoaderClient.h" | 10 #include "public/platform/WebURLLoaderClient.h" |
| 10 #include "public/platform/WebUnitTestSupport.h" | 11 #include "public/platform/WebUnitTestSupport.h" |
| 11 #include "web/WebLocalFrameImpl.h" | 12 #include "web/WebLocalFrameImpl.h" |
| 12 #include "web/tests/FrameTestHelpers.h" | 13 #include "web/tests/FrameTestHelpers.h" |
| 13 #include "wtf/TemporaryChange.h" | 14 #include "wtf/TemporaryChange.h" |
| 14 #include <gtest/gtest.h> | 15 #include <gtest/gtest.h> |
| 15 #include <queue> | 16 #include <queue> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 FrameTestHelpers::loadFrame(mainFrame(), "https://example.com/foo.html"); | 162 FrameTestHelpers::loadFrame(mainFrame(), "https://example.com/foo.html"); |
| 162 Platform::current()->unitTestSupport()->setLoaderDelegate(nullptr); | 163 Platform::current()->unitTestSupport()->setLoaderDelegate(nullptr); |
| 163 | 164 |
| 164 EXPECT_TRUE(delegate.servedReentrantly()); | 165 EXPECT_TRUE(delegate.servedReentrantly()); |
| 165 | 166 |
| 166 // delegate is a WebFrameClient and stack-allocated, so manually reset() the | 167 // delegate is a WebFrameClient and stack-allocated, so manually reset() the |
| 167 // WebViewHelper here. | 168 // WebViewHelper here. |
| 168 m_webViewHelper.reset(); | 169 m_webViewHelper.reset(); |
| 169 } | 170 } |
| 170 | 171 |
| 172 TEST_F(DocumentLoaderTest, isCommittedButEmpty) |
| 173 { |
| 174 FrameTestHelpers::WebViewHelper webViewHelper; |
| 175 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad("about:blank", tr
ue); |
| 176 EXPECT_TRUE(toLocalFrame(toCoreFrame(webViewImpl->mainFrame()))->loader().do
cumentLoader()->isCommittedButEmpty()); |
| 177 } |
| 178 |
| 171 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |