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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 1159183002: Improve process crash handling in RenderViewHost & mock RenderProcessHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile problem in webview_interactive_uitest.cc Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 manager->DidNavigateFrame(host, true); 1093 manager->DidNavigateFrame(host, true);
1094 EXPECT_TRUE( 1094 EXPECT_TRUE(
1095 host->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); 1095 host->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI);
1096 } 1096 }
1097 1097
1098 // Tests that we can open a WebUI link in a new tab from a WebUI page and still 1098 // Tests that we can open a WebUI link in a new tab from a WebUI page and still
1099 // grant the correct bindings. http://crbug.com/189101. 1099 // grant the correct bindings. http://crbug.com/189101.
1100 TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) { 1100 TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) {
1101 set_should_create_webui(true); 1101 set_should_create_webui(true);
1102 SiteInstance* blank_instance = SiteInstance::Create(browser_context()); 1102 SiteInstance* blank_instance = SiteInstance::Create(browser_context());
1103 blank_instance->GetProcess()->Init();
1103 1104
1104 // Create a blank tab. 1105 // Create a blank tab.
1105 scoped_ptr<TestWebContents> web_contents1( 1106 scoped_ptr<TestWebContents> web_contents1(
1106 TestWebContents::Create(browser_context(), blank_instance)); 1107 TestWebContents::Create(browser_context(), blank_instance));
1107 RenderFrameHostManager* manager1 = 1108 RenderFrameHostManager* manager1 =
1108 web_contents1->GetRenderManagerForTesting(); 1109 web_contents1->GetRenderManagerForTesting();
1109 // Test the case that new RVH is considered live. 1110 // Test the case that new RVH is considered live.
1110 manager1->current_host()->CreateRenderView( 1111 manager1->current_host()->CreateRenderView(
1111 base::string16(), -1, MSG_ROUTING_NONE, -1, false); 1112 base::string16(), -1, MSG_ROUTING_NONE, -1, false);
1112 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); 1113 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive());
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); 2157 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive());
2157 contents2->NavigateAndCommit(kUrl3); 2158 contents2->NavigateAndCommit(kUrl3);
2158 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); 2159 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive());
2159 EXPECT_NE(nullptr, 2160 EXPECT_NE(nullptr,
2160 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); 2161 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance()));
2161 EXPECT_EQ(nullptr, 2162 EXPECT_EQ(nullptr,
2162 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); 2163 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance()));
2163 } 2164 }
2164 2165
2165 } // namespace content 2166 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698