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

Side by Side Diff: chrome/browser/extensions/extension_crash_recovery_browsertest.cc

Issue 3386014: This adds some plumbing for propagating the status and error code of a (Closed)
Patch Set: Fixed Mac code to handle both SEGV and BUS Created 10 years, 3 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/process_util.h" 5 #include "base/process_util.h"
6 #include "chrome/browser/browser.h" 6 #include "chrome/browser/browser.h"
7 #include "chrome/browser/extensions/crashed_extension_infobar.h" 7 #include "chrome/browser/extensions/crashed_extension_infobar.h"
8 #include "chrome/browser/extensions/extension_browsertest.h" 8 #include "chrome/browser/extensions/extension_browsertest.h"
9 #include "chrome/browser/extensions/extension_host.h" 9 #include "chrome/browser/extensions/extension_host.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 Extension* extension = GetExtensionsService()->extensions()->at(index); 54 Extension* extension = GetExtensionsService()->extensions()->at(index);
55 ASSERT_TRUE(extension); 55 ASSERT_TRUE(extension);
56 std::string extension_id(extension->id()); 56 std::string extension_id(extension->id());
57 ExtensionHost* extension_host = 57 ExtensionHost* extension_host =
58 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension); 58 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension);
59 ASSERT_TRUE(extension_host); 59 ASSERT_TRUE(extension_host);
60 60
61 RenderProcessHost* extension_rph = 61 RenderProcessHost* extension_rph =
62 extension_host->render_view_host()->process(); 62 extension_host->render_view_host()->process();
63 base::KillProcess(extension_rph->GetHandle(), 63 base::KillProcess(extension_rph->GetHandle(),
64 base::PROCESS_END_KILLED_BY_USER, false); 64 base::TERMINATION_STATUS_PROCESS_WAS_KILLED, false);
65 ASSERT_TRUE(WaitForExtensionCrash(extension_id)); 65 ASSERT_TRUE(WaitForExtensionCrash(extension_id));
66 ASSERT_FALSE( 66 ASSERT_FALSE(
67 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension)); 67 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension));
68 } 68 }
69 69
70 void CheckExtensionConsistency(size_t index) { 70 void CheckExtensionConsistency(size_t index) {
71 ASSERT_LT(index, GetExtensionsService()->extensions()->size()); 71 ASSERT_LT(index, GetExtensionsService()->extensions()->size());
72 Extension* extension = GetExtensionsService()->extensions()->at(index); 72 Extension* extension = GetExtensionsService()->extensions()->at(index);
73 ASSERT_TRUE(extension); 73 ASSERT_TRUE(extension);
74 ExtensionHost* extension_host = 74 ExtensionHost* extension_host =
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 CheckExtensionConsistency(size_before); 284 CheckExtensionConsistency(size_before);
285 } 285 }
286 286
287 { 287 {
288 SCOPED_TRACE("second: infobar"); 288 SCOPED_TRACE("second: infobar");
289 AcceptCrashedExtensionInfobar(0); 289 AcceptCrashedExtensionInfobar(0);
290 CheckExtensionConsistency(size_before); 290 CheckExtensionConsistency(size_before);
291 CheckExtensionConsistency(size_before + 1); 291 CheckExtensionConsistency(size_before + 1);
292 } 292 }
293 } 293 }
OLDNEW
« no previous file with comments | « chrome/browser/child_process_security_policy_browsertest.cc ('k') | chrome/browser/extensions/sandboxed_extension_unpacker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698