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

Side by Side Diff: chrome/browser/ui/zoom/zoom_controller_browsertest.cc

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/zoom/zoom_controller.h" 5 #include "chrome/browser/ui/zoom/zoom_controller.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/process/kill.h" 8 #include "base/process/kill.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ZoomController* zoom_controller = 82 ZoomController* zoom_controller =
83 ZoomController::FromWebContents(web_contents); 83 ZoomController::FromWebContents(web_contents);
84 84
85 double old_zoom_level = zoom_controller->GetZoomLevel(); 85 double old_zoom_level = zoom_controller->GetZoomLevel();
86 double new_zoom_level = old_zoom_level + 0.5; 86 double new_zoom_level = old_zoom_level + 0.5;
87 87
88 content::RenderProcessHost* host = web_contents->GetRenderProcessHost(); 88 content::RenderProcessHost* host = web_contents->GetRenderProcessHost();
89 { 89 {
90 content::RenderProcessHostWatcher crash_observer( 90 content::RenderProcessHostWatcher crash_observer(
91 host, content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 91 host, content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
92 base::KillProcess(host->GetHandle(), 0, false); 92 host->Shutdown(0, false);
93 crash_observer.Wait(); 93 crash_observer.Wait();
94 } 94 }
95 EXPECT_FALSE(web_contents->GetRenderViewHost()->IsRenderViewLive()); 95 EXPECT_FALSE(web_contents->GetRenderViewHost()->IsRenderViewLive());
96 96
97 // The following attempt to change the zoom level for a crashed tab should 97 // The following attempt to change the zoom level for a crashed tab should
98 // fail. 98 // fail.
99 zoom_controller->SetZoomLevel(new_zoom_level); 99 zoom_controller->SetZoomLevel(new_zoom_level);
100 EXPECT_FLOAT_EQ(old_zoom_level, zoom_controller->GetZoomLevel()); 100 EXPECT_FLOAT_EQ(old_zoom_level, zoom_controller->GetZoomLevel());
101 } 101 }
102 102
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ZoomController::ZOOM_MODE_DEFAULT, 159 ZoomController::ZOOM_MODE_DEFAULT,
160 true); // We have a non-empty host, so this will be 'true'. 160 true); // We have a non-empty host, so this will be 'true'.
161 EXPECT_CALL(zoom_observer_, OnZoomChanged(zoom_change_data)).Times(1); 161 EXPECT_CALL(zoom_observer_, OnZoomChanged(zoom_change_data)).Times(1);
162 162
163 content::HostZoomMap* host_zoom_map = 163 content::HostZoomMap* host_zoom_map =
164 content::HostZoomMap::GetDefaultForBrowserContext( 164 content::HostZoomMap::GetDefaultForBrowserContext(
165 web_contents->GetBrowserContext()); 165 web_contents->GetBrowserContext());
166 166
167 host_zoom_map->SetZoomLevelForHost("about:blank", new_zoom_level); 167 host_zoom_map->SetZoomLevelForHost("about:blank", new_zoom_level);
168 } 168 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/hung_renderer_view.cc ('k') | content/browser/child_process_security_policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698