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

Side by Side Diff: content/browser/web_contents/web_contents_impl_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/logging.h" 6 #include "base/logging.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/browser/frame_host/cross_site_transferring_request.h" 8 #include "content/browser/frame_host/cross_site_transferring_request.h"
9 #include "content/browser/frame_host/interstitial_page_impl.h" 9 #include "content/browser/frame_host/interstitial_page_impl.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 } 1438 }
1439 1439
1440 contents()->SetDelegate(nullptr); 1440 contents()->SetDelegate(nullptr);
1441 } 1441 }
1442 1442
1443 TEST_F(WebContentsImplTest, TerminateHidesValidationMessage) { 1443 TEST_F(WebContentsImplTest, TerminateHidesValidationMessage) {
1444 FakeValidationMessageDelegate fake_delegate; 1444 FakeValidationMessageDelegate fake_delegate;
1445 contents()->SetDelegate(&fake_delegate); 1445 contents()->SetDelegate(&fake_delegate);
1446 EXPECT_FALSE(fake_delegate.hide_validation_message_was_called()); 1446 EXPECT_FALSE(fake_delegate.hide_validation_message_was_called());
1447 1447
1448 // Crash the renderer. 1448 // Initialize the RenderFrame and then simulate crashing the renderer
1449 // process.
1450 contents()->GetMainFrame()->InitializeRenderFrameIfNeeded();
1449 contents()->GetMainFrame()->GetProcess()->SimulateCrash(); 1451 contents()->GetMainFrame()->GetProcess()->SimulateCrash();
1450 1452
1451 // Confirm HideValidationMessage was called. 1453 // Confirm HideValidationMessage was called.
1452 EXPECT_TRUE(fake_delegate.hide_validation_message_was_called()); 1454 EXPECT_TRUE(fake_delegate.hide_validation_message_was_called());
1453 1455
1454 contents()->SetDelegate(nullptr); 1456 contents()->SetDelegate(nullptr);
1455 } 1457 }
1456 1458
1457 // Tests that fullscreen is exited throughout the object hierarchy on a renderer 1459 // Tests that fullscreen is exited throughout the object hierarchy on a renderer
1458 // crash. 1460 // crash.
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
3158 // Additional changes made by the web contents should propagate as well. 3160 // Additional changes made by the web contents should propagate as well.
3159 RenderViewHostTester::TestOnMessageReceived( 3161 RenderViewHostTester::TestOnMessageReceived(
3160 test_rvh(), 3162 test_rvh(),
3161 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN)); 3163 FrameHostMsg_DidChangeThemeColor(rfh->GetRoutingID(), SK_ColorGREEN));
3162 3164
3163 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor()); 3165 EXPECT_EQ(SK_ColorGREEN, contents()->GetThemeColor());
3164 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color()); 3166 EXPECT_EQ(SK_ColorGREEN, observer.last_theme_color());
3165 } 3167 }
3166 3168
3167 } // namespace content 3169 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac_unittest.mm ('k') | content/public/test/mock_render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698