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

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 for WebViewInteractiveUiTest.TextInputClientIsUpToDate 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/frame_host/cross_site_transferring_request.h" 10 #include "content/browser/frame_host/cross_site_transferring_request.h"
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 manager->DidNavigateFrame(host, true); 1085 manager->DidNavigateFrame(host, true);
1086 EXPECT_TRUE( 1086 EXPECT_TRUE(
1087 host->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI); 1087 host->render_view_host()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI);
1088 } 1088 }
1089 1089
1090 // Tests that we can open a WebUI link in a new tab from a WebUI page and still 1090 // Tests that we can open a WebUI link in a new tab from a WebUI page and still
1091 // grant the correct bindings. http://crbug.com/189101. 1091 // grant the correct bindings. http://crbug.com/189101.
1092 TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) { 1092 TEST_F(RenderFrameHostManagerTest, WebUIInNewTab) {
1093 set_should_create_webui(true); 1093 set_should_create_webui(true);
1094 SiteInstance* blank_instance = SiteInstance::Create(browser_context()); 1094 SiteInstance* blank_instance = SiteInstance::Create(browser_context());
1095 blank_instance->GetProcess()->Init();
1095 1096
1096 // Create a blank tab. 1097 // Create a blank tab.
1097 scoped_ptr<TestWebContents> web_contents1( 1098 scoped_ptr<TestWebContents> web_contents1(
1098 TestWebContents::Create(browser_context(), blank_instance)); 1099 TestWebContents::Create(browser_context(), blank_instance));
1099 RenderFrameHostManager* manager1 = 1100 RenderFrameHostManager* manager1 =
1100 web_contents1->GetRenderManagerForTesting(); 1101 web_contents1->GetRenderManagerForTesting();
1101 // Test the case that new RVH is considered live. 1102 // Test the case that new RVH is considered live.
1102 manager1->current_host()->CreateRenderView( 1103 manager1->current_host()->CreateRenderView(
1103 base::string16(), -1, MSG_ROUTING_NONE, -1, false); 1104 base::string16(), -1, MSG_ROUTING_NONE, -1, false);
1104 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive()); 1105 EXPECT_TRUE(manager1->current_host()->IsRenderViewLive());
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); 2149 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive());
2149 contents2->NavigateAndCommit(kUrl3); 2150 contents2->NavigateAndCommit(kUrl3);
2150 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); 2151 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive());
2151 EXPECT_NE(nullptr, 2152 EXPECT_NE(nullptr,
2152 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); 2153 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance()));
2153 EXPECT_EQ(nullptr, 2154 EXPECT_EQ(nullptr,
2154 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); 2155 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance()));
2155 } 2156 }
2156 2157
2157 } // namespace content 2158 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698