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

Side by Side Diff: content/browser/renderer_host/render_process_host_browsertest.cc

Issue 16267002: Re-fix http://crbug.com/87176, and add a test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to a browser test 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/common/child_process_messages.h"
6 #include "content/public/browser/notification_types.h"
7 #include "content/public/browser/render_process_host.h"
8 #include "content/public/browser/render_view_host.h"
9 #include "content/public/browser/web_contents.h"
10 #include "content/public/test/test_notification_tracker.h"
11 #include "content/shell/shell.h"
12 #include "content/test/content_browser_test.h"
13 #include "content/test/content_browser_test_utils.h"
14 #include "net/test/embedded_test_server/embedded_test_server.h"
15
16 namespace content {
17 namespace {
18
19 class RenderProcessHostTest : public ContentBrowserTest {};
20
21 IN_PROC_BROWSER_TEST_F(RenderProcessHostTest,
jam 2013/06/13 17:43:22 nit: please add a comment explaining the purpose o
Jeffrey Yasskin 2013/06/13 17:54:04 Oops, I thought I had, but that was the unit test.
22 ShutdownRequestFromActiveTabIgnored) {
23 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
24
25 GURL test_url = embedded_test_server()->GetURL("/simple_page.html");
26 NavigateToURL(shell(), test_url);
27 RenderProcessHost* rph =
28 shell()->web_contents()->GetRenderViewHost()->GetProcess();
29
30 TestNotificationTracker termination_watcher;
31 termination_watcher.ListenFor(NOTIFICATION_RENDERER_PROCESS_CLOSED,
32 Source<RenderProcessHost>(rph));
33 ChildProcessHostMsg_ShutdownRequest msg;
34 rph->OnMessageReceived(msg);
35
36 // If the RPH sends a mistaken ChildProcessMsg_Shutdown, the renderer process
37 // will take some time to die. Wait for a second tab to load in order to give
38 // that time to happen.
39 NavigateToURL(CreateBrowser(), test_url);
40
41 EXPECT_EQ(0U, termination_watcher.size());
42 }
43
44 } // namespace
45 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698