| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/browser/android/render_widget_host_connector_browsertest.h" | 5 #include "content/browser/android/render_widget_host_connector_browsertest.h" |
| 6 | 6 |
| 7 #include "content/browser/frame_host/interstitial_page_impl.h" | 7 #include "content/browser/frame_host/interstitial_page_impl.h" |
| 8 #include "content/public/browser/interstitial_page_delegate.h" | 8 #include "content/public/browser/interstitial_page_delegate.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test_utils.h" | 10 #include "content/public/test/content_browser_test_utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 private: | 21 private: |
| 22 // InterstitialPageDelegate implementation. | 22 // InterstitialPageDelegate implementation. |
| 23 std::string GetHTMLContents() override { return "<p>Interstitial</p>"; } | 23 std::string GetHTMLContents() override { return "<p>Interstitial</p>"; } |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 RenderWidgetHostConnectorTest::RenderWidgetHostConnectorTest() {} | 28 RenderWidgetHostConnectorTest::RenderWidgetHostConnectorTest() {} |
| 29 | 29 |
| 30 void RenderWidgetHostConnectorTest::SetUpOnMainThread() { | 30 void RenderWidgetHostConnectorTest::SetUpOnMainThread() { |
| 31 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 32 SetupCrossSiteRedirector(embedded_test_server()); | |
| 33 ASSERT_TRUE(embedded_test_server()->Start()); | 31 ASSERT_TRUE(embedded_test_server()->Start()); |
| 34 } | 32 } |
| 35 | 33 |
| 36 IN_PROC_BROWSER_TEST_F(RenderWidgetHostConnectorTest, | 34 IN_PROC_BROWSER_TEST_F(RenderWidgetHostConnectorTest, |
| 37 RenderViewCreatedBeforeConnector) { | 35 RenderViewCreatedBeforeConnector) { |
| 38 GURL main_url(embedded_test_server()->GetURL("/page_with_popup.html")); | 36 GURL main_url(embedded_test_server()->GetURL("/page_with_popup.html")); |
| 39 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 37 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
| 40 | 38 |
| 41 // Navigate to the enclosed <iframe>. | 39 // Navigate to the enclosed <iframe>. |
| 42 FrameTreeNode* iframe = web_contents()->GetFrameTree()->root()->child_at(0); | 40 FrameTreeNode* iframe = web_contents()->GetFrameTree()->root()->child_at(0); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 RenderWidgetHostViewAndroid* rwhva = render_widget_host_view_android(); | 127 RenderWidgetHostViewAndroid* rwhva = render_widget_host_view_android(); |
| 130 RenderWidgetHostConnector* connector = render_widget_host_connector(); | 128 RenderWidgetHostConnector* connector = render_widget_host_connector(); |
| 131 EXPECT_EQ(connector, connector_in_rwhva(rwhva)); | 129 EXPECT_EQ(connector, connector_in_rwhva(rwhva)); |
| 132 | 130 |
| 133 // Generate WebContentsObserver::WebContentsDestroyed by closing the contents. | 131 // Generate WebContentsObserver::WebContentsDestroyed by closing the contents. |
| 134 web_contents()->Close(); | 132 web_contents()->Close(); |
| 135 EXPECT_EQ(nullptr, connector_in_rwhva(rwhva)); | 133 EXPECT_EQ(nullptr, connector_in_rwhva(rwhva)); |
| 136 } | 134 } |
| 137 | 135 |
| 138 } // namespace content | 136 } // namespace content |
| OLD | NEW |