Chromium Code Reviews| Index: chrome/browser/apps/guest_view/web_view_browsertest.cc |
| diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc |
| index 6786241ddf747d59b89a796d0b3efccb3e7c075c..d4d5aaed955bf6bcf5ab2e8f7017c563f8971787 100644 |
| --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc |
| +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc |
| @@ -1593,6 +1593,31 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, OpenURLFromTab_CurrentTab_Abort) { |
| GetGuestWebContents()->GetLastCommittedURL()); |
| } |
| +// A navigation to a web-safe URL should succeed, even if it is not renderer- |
| +// initiated, such as a navigation from the PDF viewer. |
| +IN_PROC_BROWSER_TEST_F(WebViewTest, OpenURLFromTab_CurrentTab_Succeed) { |
| + LoadAppWithGuest("web_view/simple"); |
| + |
| + // Verify that OpenURLFromTab with a window disposition of CURRENT_TAB will |
| + // navigate the current <webview>. |
| + ExtensionTestMessageListener load_listener("WebViewTest.LOADSTOP", false); |
| + |
| + GURL test_url("http://www.google.com"); |
| + // Navigating to a file URL is forbidden inside a <webview>. |
|
Charlie Reis
2015/07/17 00:05:15
This comment is stale. The navigation is supposed
wjmaclean
2015/07/17 01:29:46
Done.
|
| + content::OpenURLParams params(test_url, |
| + content::Referrer(), |
| + CURRENT_TAB, |
| + ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| + false /* is_renderer_initiated */); |
| + GetGuestWebContents()->GetDelegate()->OpenURLFromTab( |
| + GetGuestWebContents(), params); |
| + |
| + ASSERT_TRUE(load_listener.WaitUntilSatisfied()); |
| + |
| + // Verify that the <webview> ends up at about:blank. |
|
Charlie Reis
2015/07/17 00:05:15
This comment is stale.
wjmaclean
2015/07/17 01:29:46
Done.
|
| + EXPECT_EQ(test_url, GetGuestWebContents()->GetLastCommittedURL()); |
| +} |
| + |
| IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, OpenURLFromTab_NewWindow_Abort) { |
| LoadAppWithGuest("web_view/simple"); |