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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc

Issue 2385363002: Pass the RenderProcessHost id on retargeting. (Closed)
Patch Set: Address review feedback and compile problem. Created 4 years, 2 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
Index: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
index fac22e170844bcee11bdb95c1ac7d0340b184cb4..c542d111c49ef9acf6473ec40bc9d6bd31a91488 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
@@ -505,6 +505,7 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, FilteredTest) {
}
IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, UserAction) {
+ content::IsolateAllSitesForTesting(base::CommandLine::ForCurrentProcess());
ASSERT_TRUE(StartEmbeddedTestServer());
// Wait for the extension to set itself up and return control to us.
@@ -519,7 +520,8 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, UserAction) {
browser()->profile())->extension_service();
const extensions::Extension* extension =
service->GetExtensionById(last_loaded_extension_id(), false);
- GURL url = extension->GetResourceURL("a.html");
+ GURL url = extension->GetResourceURL(
+ "a.html?" + base::IntToString(embedded_test_server()->port()));
ui_test_utils::NavigateToURL(browser(), url);
@@ -530,7 +532,13 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, UserAction) {
params.page_url = url;
params.link_url = extension->GetResourceURL("b.html");
- TestRenderViewContextMenu menu(tab->GetMainFrame(), params);
+ // Get the child frame, which will be the one associated with the context
+ // menu.
+ std::vector<content::RenderFrameHost*> frames = tab->GetAllFrames();
+ EXPECT_EQ(2UL, frames.size());
+ EXPECT_TRUE(frames[1]->GetParent());
+
+ TestRenderViewContextMenu menu(frames[1], params);
menu.Init();
menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB, 0);

Powered by Google App Engine
This is Rietveld 408576698