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

Unified Diff: content/test/content_browser_test_utils_internal.cc

Issue 1224363002: OOPIF: Fix window.open to work from frames with remote parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove internal:: from ToRenderFrameHost Created 5 years, 5 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 | « content/test/content_browser_test_utils_internal.h ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test_utils_internal.cc
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc
index 9097a8955fe6a5e4fbc0791d04f124d981adb587..ea1d17ebce72a4954d21d6112dec0270f3acb683 100644
--- a/content/test/content_browser_test_utils_internal.cc
+++ b/content/test/content_browser_test_utils_internal.cc
@@ -13,6 +13,9 @@
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/render_frame_proxy_host.h"
+#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/content_browser_test_utils.h"
+#include "content/shell/browser/shell.h"
#include "content/test/test_frame_navigation_observer.h"
#include "url/gurl.h"
@@ -219,4 +222,22 @@ std::string FrameTreeVisualizer::GetName(SiteInstance* site_instance) {
return base::StringPrintf("Z%d", static_cast<int>(index - 25));
}
+Shell* OpenPopup(const ToRenderFrameHost& opener,
+ const GURL& url,
+ const std::string& name) {
+ ShellAddedObserver new_shell_observer;
+ bool did_create_popup = false;
+ bool did_execute_script = ExecuteScriptAndExtractBool(
+ opener,
+ "window.domAutomationController.send("
+ " !!window.open('" + url.spec() + "', '" + name + "'));",
+ &did_create_popup);
+ if (!did_execute_script || !did_create_popup)
+ return nullptr;
+
+ Shell* new_shell = new_shell_observer.GetShell();
+ WaitForLoadStop(new_shell->web_contents());
+ return new_shell;
+}
+
} // namespace content
« no previous file with comments | « content/test/content_browser_test_utils_internal.h ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698