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

Side by Side Diff: chrome/browser/chrome_site_per_process_browsertest.cc

Issue 2553783003: Don't consume user gesture in RenderFrameProxy::navigate. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 browser()->tab_strip_model()->GetActiveWebContents(); 336 browser()->tab_strip_model()->GetActiveWebContents();
337 GURL frame_url = 337 GURL frame_url =
338 embedded_test_server()->GetURL("b.com", "/page_with_embedded_pdf.html"); 338 embedded_test_server()->GetURL("b.com", "/page_with_embedded_pdf.html");
339 339
340 // Ensure the page finishes loading without crashing. 340 // Ensure the page finishes loading without crashing.
341 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", frame_url)); 341 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", frame_url));
342 342
343 // Wait until the guest for PDF is created. 343 // Wait until the guest for PDF is created.
344 test_guest_view_manager()->WaitForSingleGuestCreated(); 344 test_guest_view_manager()->WaitForSingleGuestCreated();
345 } 345 }
346
347 // Verify that a popup can be opened after navigating a remote frame. This has
348 // to be a chrome/ test to ensure that the popup blocker doesn't block the
349 // popup. See https://crbug.com/670770.
350 IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest,
351 NavigateRemoteFrameAndOpenPopup) {
352 // Start on a page with an <iframe>.
353 GURL main_url(embedded_test_server()->GetURL("a.com", "/iframe.html"));
354 ui_test_utils::NavigateToURL(browser(), main_url);
355
356 // Navigate the iframe cross-site.
357 content::WebContents* active_web_contents =
358 browser()->tab_strip_model()->GetActiveWebContents();
359 GURL frame_url(embedded_test_server()->GetURL("b.com", "/title1.html"));
360 EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", frame_url));
361
362 // Run a script in the parent frame to (1) navigate iframe to another URL,
363 // and (2) open a popup. Note that ExecuteScript will run this with a user
364 // gesture, so both steps should succeed.
365 frame_url = embedded_test_server()->GetURL("c.com", "/title1.html");
366 content::WindowedNotificationObserver popup_observer(
367 chrome::NOTIFICATION_TAB_ADDED,
368 content::NotificationService::AllSources());
369 bool popup_handle_is_valid = false;
370 EXPECT_TRUE(ExecuteScriptAndExtractBool(
371 active_web_contents,
372 "document.querySelector('iframe').src = '" + frame_url.spec() + "';\n"
373 "var w = window.open('about:blank');\n"
374 "window.domAutomationController.send(!!w);\n",
375 &popup_handle_is_valid));
376 popup_observer.Wait();
377
378 // The popup shouldn't be blocked.
379 EXPECT_TRUE(popup_handle_is_valid);
380 ASSERT_EQ(2, browser()->tab_strip_model()->count());
381 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_proxy.cc » ('j') | content/renderer/render_frame_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698