Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 1350073002: PDFs viewed inside a <webview> should navigate the same as PDFs in tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass boolean instead of tabId. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/pdf/pdf.js » ('j') | chrome/browser/resources/pdf/pdf.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 478b3d19b50459f3bacb07d59f10bca0343779d0..8c3491f1bcddb09c160d15a60ffb38d03a9544c5 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -1625,6 +1625,27 @@ 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");
+ 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());
+
+ EXPECT_EQ(test_url, GetGuestWebContents()->GetLastCommittedURL());
+}
+
IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, OpenURLFromTab_NewWindow_Abort) {
LoadAppWithGuest("web_view/simple");
« no previous file with comments | « no previous file | chrome/browser/resources/pdf/pdf.js » ('j') | chrome/browser/resources/pdf/pdf.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698