OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_apitest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_apitest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 RunTest("testReassignSrcAttribute", "web_view/apitest"); | 629 RunTest("testReassignSrcAttribute", "web_view/apitest"); |
630 } | 630 } |
631 | 631 |
632 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestRemoveWebviewOnExit) { | 632 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestRemoveWebviewOnExit) { |
633 StartTestServer(); | 633 StartTestServer(); |
634 | 634 |
635 // Launch the app and wait until it's ready to load a test. | 635 // Launch the app and wait until it's ready to load a test. |
636 LaunchApp("web_view/apitest"); | 636 LaunchApp("web_view/apitest"); |
637 | 637 |
638 GURL::Replacements replace_host; | 638 GURL::Replacements replace_host; |
639 std::string host_str("localhost"); // Must stay in scope with replace_host. | 639 replace_host.SetHostStr("localhost"); |
640 replace_host.SetHostStr(host_str); | |
641 | 640 |
642 // Run the test and wait until the guest WebContents is available and has | 641 // Run the test and wait until the guest WebContents is available and has |
643 // finished loading. | 642 // finished loading. |
644 ExtensionTestMessageListener guest_loaded_listener("guest-loaded", false); | 643 ExtensionTestMessageListener guest_loaded_listener("guest-loaded", false); |
645 EXPECT_TRUE(content::ExecuteScript(embedder_web_contents_, | 644 EXPECT_TRUE(content::ExecuteScript(embedder_web_contents_, |
646 "runTest('testRemoveWebviewOnExit')")); | 645 "runTest('testRemoveWebviewOnExit')")); |
647 | 646 |
648 content::WebContents* guest_web_contents = GetGuestWebContents(); | 647 content::WebContents* guest_web_contents = GetGuestWebContents(); |
649 EXPECT_TRUE(guest_web_contents->GetRenderProcessHost()->IsIsolatedGuest()); | 648 EXPECT_TRUE(guest_web_contents->GetRenderProcessHost()->IsIsolatedGuest()); |
650 ASSERT_TRUE(guest_loaded_listener.WaitUntilSatisfied()); | 649 ASSERT_TRUE(guest_loaded_listener.WaitUntilSatisfied()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 705 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); |
707 } | 706 } |
708 | 707 |
709 // This test verifies that webview.contentWindow works inside an iframe | 708 // This test verifies that webview.contentWindow works inside an iframe |
710 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { | 709 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { |
711 LaunchApp("web_view/inside_iframe"); | 710 LaunchApp("web_view/inside_iframe"); |
712 } | 711 } |
713 | 712 |
714 | 713 |
715 } // namespace extensions | 714 } // namespace extensions |
OLD | NEW |