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