| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 TestGetConfigFunction::set_test_config_state(&test_config_); | 189 TestGetConfigFunction::set_test_config_state(&test_config_); |
| 190 base::FilePath test_data_dir; | 190 base::FilePath test_data_dir; |
| 191 test_config_.SetInteger(kTestWebSocketPort, 0); | 191 test_config_.SetInteger(kTestWebSocketPort, 0); |
| 192 test_config_.SetBoolean(kSitePerProcess, | 192 test_config_.SetBoolean(kSitePerProcess, |
| 193 base::CommandLine::ForCurrentProcess()->HasSwitch( | 193 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 194 switches::kSitePerProcess)); | 194 switches::kSitePerProcess)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void WebViewAPITest::StartTestServer() { | 197 void WebViewAPITest::StartTestServer() { |
| 198 // For serving guest pages. | 198 // For serving guest pages. |
| 199 if (!embedded_test_server()->InitializeAndWaitUntilReady()) { | 199 if (!embedded_test_server()->Start()) { |
| 200 LOG(ERROR) << "Failed to start test server."; | 200 LOG(ERROR) << "Failed to start test server."; |
| 201 return; | 201 return; |
| 202 } | 202 } |
| 203 | 203 |
| 204 test_config_.SetInteger(kTestServerPort, embedded_test_server()->port()); | 204 test_config_.SetInteger(kTestServerPort, embedded_test_server()->port()); |
| 205 | 205 |
| 206 embedded_test_server()->RegisterRequestHandler( | 206 embedded_test_server()->RegisterRequestHandler( |
| 207 base::Bind(&RedirectResponseHandler, | 207 base::Bind(&RedirectResponseHandler, |
| 208 kRedirectResponsePath, | 208 kRedirectResponsePath, |
| 209 embedded_test_server()->GetURL(kRedirectResponseFullPath))); | 209 embedded_test_server()->GetURL(kRedirectResponseFullPath))); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); | 725 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); |
| 726 } | 726 } |
| 727 | 727 |
| 728 // This test verifies that webview.contentWindow works inside an iframe | 728 // This test verifies that webview.contentWindow works inside an iframe |
| 729 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { | 729 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) { |
| 730 LaunchApp("web_view/inside_iframe"); | 730 LaunchApp("web_view/inside_iframe"); |
| 731 } | 731 } |
| 732 | 732 |
| 733 | 733 |
| 734 } // namespace extensions | 734 } // namespace extensions |
| OLD | NEW |