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

Unified Diff: content/browser/renderer_host/render_view_host_manager_browsertest.cc

Issue 10344028: Support cross-process window.close() messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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: content/browser/renderer_host/render_view_host_manager_browsertest.cc
diff --git a/content/browser/renderer_host/render_view_host_manager_browsertest.cc b/content/browser/renderer_host/render_view_host_manager_browsertest.cc
index e3925361c49b8c3adba4ad98118ed46c2d6cde9b..917947b50cf4c63db529c17fc3c494472876829d 100644
--- a/content/browser/renderer_host/render_view_host_manager_browsertest.cc
+++ b/content/browser/renderer_host/render_view_host_manager_browsertest.cc
@@ -389,7 +389,6 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
EXPECT_EQ(orig_site_instance, blank_site_instance);
// Now navigate the new tab to a different site.
- //browser()->ActivateTabAt(1, true);
content::WebContents* new_contents = browser()->GetSelectedWebContents();
ui_test_utils::NavigateToURL(browser(),
https_server.GetURL("files/title1.html"));
@@ -415,6 +414,23 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest,
scoped_refptr<SiteInstance> revisit_site_instance(
browser()->GetSelectedWebContents()->GetSiteInstance());
EXPECT_EQ(orig_site_instance, revisit_site_instance);
+
+ // If it navigates away to another process, the original window should
+ // still be able to close it (using a cross-process close message).
+ ui_test_utils::NavigateToURL(browser(),
+ https_server.GetURL("files/title1.html"));
+ EXPECT_EQ(new_site_instance,
+ browser()->GetSelectedWebContents()->GetSiteInstance());
+ browser()->ActivateTabAt(0, true);
+ ui_test_utils::WindowedNotificationObserver close_observer(
+ content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
+ content::Source<content::WebContents>(new_contents));
+ EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ browser()->GetSelectedWebContents()->GetRenderViewHost(), L"",
+ L"window.domAutomationController.send(testCloseWindow());",
+ &success));
+ EXPECT_TRUE(success);
+ close_observer.Wait();
}
// Test for crbug.com/116192. Navigations to a window's opener should
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698