| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()-> | 564 EXPECT_TRUE(source->GetWebContents()->GetRenderProcessHost()-> |
| 565 IsForGuestsOnly()); | 565 IsForGuestsOnly()); |
| 566 | 566 |
| 567 content::WebContents* guest_web_contents = source->GetWebContents(); | 567 content::WebContents* guest_web_contents = source->GetWebContents(); |
| 568 return guest_web_contents; | 568 return guest_web_contents; |
| 569 } | 569 } |
| 570 | 570 |
| 571 // Helper to load interstitial page in a <webview>. | 571 // Helper to load interstitial page in a <webview>. |
| 572 void InterstitialTeardownTestHelper() { | 572 void InterstitialTeardownTestHelper() { |
| 573 // Start a HTTPS server so we can load an interstitial page inside guest. | 573 // Start a HTTPS server so we can load an interstitial page inside guest. |
| 574 net::SpawnedTestServer::SSLOptions ssl_options; | 574 net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); |
| 575 ssl_options.server_certificate = | 575 https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_MISMATCHED_NAME); |
| 576 net::SpawnedTestServer::SSLOptions::CERT_MISMATCHED_NAME; | 576 https_server.ServeFilesFromSourceDirectory("chrome/test/data"); |
| 577 net::SpawnedTestServer https_server( | |
| 578 net::SpawnedTestServer::TYPE_HTTPS, ssl_options, | |
| 579 base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | |
| 580 ASSERT_TRUE(https_server.Start()); | 577 ASSERT_TRUE(https_server.Start()); |
| 581 | 578 |
| 582 net::HostPortPair host_and_port = https_server.host_port_pair(); | 579 net::HostPortPair host_and_port = https_server.host_port_pair(); |
| 583 | 580 |
| 584 LoadAndLaunchPlatformApp("web_view/interstitial_teardown", | 581 LoadAndLaunchPlatformApp("web_view/interstitial_teardown", |
| 585 "EmbedderLoaded"); | 582 "EmbedderLoaded"); |
| 586 | 583 |
| 587 // Now load the guest. | 584 // Now load the guest. |
| 588 content::WebContents* embedder_web_contents = | 585 content::WebContents* embedder_web_contents = |
| 589 GetFirstAppWindowWebContents(); | 586 GetFirstAppWindowWebContents(); |
| (...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2984 // 4 tasks expected. The order is arbitrary. | 2981 // 4 tasks expected. The order is arbitrary. |
| 2985 // Tab: about:blank, | 2982 // Tab: about:blank, |
| 2986 // Background Page: <webview> task manager test, | 2983 // Background Page: <webview> task manager test, |
| 2987 // App: <webview> task manager test, | 2984 // App: <webview> task manager test, |
| 2988 // Webview: WebViewed test content. | 2985 // Webview: WebViewed test content. |
| 2989 EXPECT_EQ(4U, task_manager.tasks().size()); | 2986 EXPECT_EQ(4U, task_manager.tasks().size()); |
| 2990 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); | 2987 EXPECT_TRUE(HasExpectedGuestTask(task_manager, guest_contents)); |
| 2991 } | 2988 } |
| 2992 | 2989 |
| 2993 #endif // defined(ENABLE_TASK_MANAGER) | 2990 #endif // defined(ENABLE_TASK_MANAGER) |
| OLD | NEW |