Chromium Code Reviews| 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 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 3274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3285 TestHelper("testBlobURL", "web_view/shim", NEEDS_TEST_SERVER); | 3285 TestHelper("testBlobURL", "web_view/shim", NEEDS_TEST_SERVER); |
| 3286 } | 3286 } |
| 3287 | 3287 |
| 3288 // Tests that a WebView accessible resource can actually be loaded from a | 3288 // Tests that a WebView accessible resource can actually be loaded from a |
| 3289 // webpage in a WebView. | 3289 // webpage in a WebView. |
| 3290 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewAccessibleResource) { | 3290 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewAccessibleResource) { |
| 3291 TestHelper("testLoadWebviewAccessibleResource", | 3291 TestHelper("testLoadWebviewAccessibleResource", |
| 3292 "web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER); | 3292 "web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER); |
| 3293 } | 3293 } |
| 3294 | 3294 |
| 3295 // Tests that a WebView can reload a WebView accessible resource. See | |
| 3296 // https://crbug.com/691941. | |
| 3297 IN_PROC_BROWSER_TEST_P(WebViewTest, ReloadWebviewAccessibleResource) { | |
| 3298 TestHelper("testReloadWebviewAccessibleResource", | |
| 3299 "web_view/load_webview_accessible_resource", NEEDS_TEST_SERVER); | |
| 3300 | |
| 3301 content::WebContents* embedder_contents = GetEmbedderWebContents(); | |
| 3302 content::WebContents* web_view_contents = | |
| 3303 GetGuestViewManager()->GetLastGuestCreated(); | |
| 3304 ASSERT_TRUE(embedder_contents); | |
| 3305 ASSERT_TRUE(web_view_contents); | |
| 3306 | |
| 3307 GURL embedder_url(embedder_contents->GetLastCommittedURL()); | |
| 3308 GURL::Replacements replace_path; | |
| 3309 replace_path.SetPathStr("/assets/foo.html"); | |
|
Devlin
2017/03/22 21:58:56
GURL::Replacements always drive me crazy... there'
alexmos
2017/03/22 23:56:39
I'm not a big fan of replacements either, so I jus
| |
| 3310 GURL webview_url(embedder_url.ReplaceComponents(replace_path)); | |
| 3311 | |
| 3312 EXPECT_EQ(webview_url, web_view_contents->GetLastCommittedURL()); | |
| 3313 } | |
| 3314 | |
| 3295 // Tests that a webview inside an iframe can load and that it is destroyed when | 3315 // Tests that a webview inside an iframe can load and that it is destroyed when |
| 3296 // the iframe is detached. | 3316 // the iframe is detached. |
| 3297 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewInsideIframe) { | 3317 IN_PROC_BROWSER_TEST_P(WebViewTest, LoadWebviewInsideIframe) { |
| 3298 TestHelper("testLoadWebviewInsideIframe", | 3318 TestHelper("testLoadWebviewInsideIframe", |
| 3299 "web_view/load_webview_inside_iframe", NEEDS_TEST_SERVER); | 3319 "web_view/load_webview_inside_iframe", NEEDS_TEST_SERVER); |
| 3300 | 3320 |
| 3301 // WebContents is leaked when using BrowserPlugin. | 3321 // WebContents is leaked when using BrowserPlugin. |
| 3302 if (!base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) | 3322 if (!base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) |
| 3303 return; | 3323 return; |
| 3304 | 3324 |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3962 ClosingChromeSignInShouldNotCrash) { | 3982 ClosingChromeSignInShouldNotCrash) { |
| 3963 GURL signin_url{"chrome://chrome-signin"}; | 3983 GURL signin_url{"chrome://chrome-signin"}; |
| 3964 | 3984 |
| 3965 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED); | 3985 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED); |
| 3966 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED); | 3986 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED); |
| 3967 WaitForWebViewInDom(); | 3987 WaitForWebViewInDom(); |
| 3968 | 3988 |
| 3969 chrome::CloseTab(browser()); | 3989 chrome::CloseTab(browser()); |
| 3970 } | 3990 } |
| 3971 #endif | 3991 #endif |
| OLD | NEW |