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

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

Issue 16593002: Fix http://crbug.com/87176, and write a browsertest for it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_browsertest.cc
diff --git a/content/browser/renderer_host/render_view_host_browsertest.cc b/content/browser/renderer_host/render_view_host_browsertest.cc
index 0bd8f1e3b299c568f109671b0eec891102abd9c3..03de840a8f8b8fe22e9ca3a8b5c6ac1a1da4177f 100644
--- a/content/browser/renderer_host/render_view_host_browsertest.cc
+++ b/content/browser/renderer_host/render_view_host_browsertest.cc
@@ -8,11 +8,13 @@
#include "base/values.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/common/child_process_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/test_notification_tracker.h"
#include "content/shell/shell.h"
#include "content/test/content_browser_test.h"
#include "content/test/content_browser_test_utils.h"
@@ -115,4 +117,28 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostTest, BasicRenderFrameHost) {
new_rvh->main_render_frame_host_->routing_id());
}
+IN_PROC_BROWSER_TEST_F(RenderViewHostTest,
+ ShutdownRequestFromActiveTabIgnored) {
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+
+ GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
+ NavigateToURL(shell(), test_url);
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
+ shell()->web_contents()->GetRenderViewHost());
+ RenderProcessHost* rph = rvh->GetProcess();
+
+ TestNotificationTracker termination_watcher;
+ termination_watcher.ListenFor(NOTIFICATION_RENDERER_PROCESS_CLOSED,
+ Source<RenderProcessHost>(rph));
+ ChildProcessHostMsg_ShutdownRequest msg;
+ rvh->GetProcess()->OnMessageReceived(msg);
+
+ // If the RPH sends a mistaken ChildProcessMsg_Shutdown, the renderer process
+ // will take some time to die. Wait for a second tab to load in order to give
+ // that time to happen.
+ NavigateToURL(CreateBrowser(), test_url);
+
+ EXPECT_EQ(0U, termination_watcher.size());
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698