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

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

Issue 7377010: This change will split the result codes between content and chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: actually rename the files Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_process.h" 6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/extensions/extension_browsertest.h" 7 #include "chrome/browser/extensions/extension_browsertest.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 const Extension* extension = 66 const Extension* extension =
67 GetExtensionService()->extensions()->at(index); 67 GetExtensionService()->extensions()->at(index);
68 ASSERT_TRUE(extension); 68 ASSERT_TRUE(extension);
69 std::string extension_id(extension->id()); 69 std::string extension_id(extension->id());
70 ExtensionHost* extension_host = 70 ExtensionHost* extension_host =
71 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension); 71 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension);
72 ASSERT_TRUE(extension_host); 72 ASSERT_TRUE(extension_host);
73 73
74 RenderProcessHost* extension_rph = 74 RenderProcessHost* extension_rph =
75 extension_host->render_view_host()->process(); 75 extension_host->render_view_host()->process();
76 base::KillProcess(extension_rph->GetHandle(), ResultCodes::KILLED, false); 76 base::KillProcess(extension_rph->GetHandle(), content::RESULT_CODE_KILLED,
77 false);
77 ASSERT_TRUE(WaitForExtensionCrash(extension_id)); 78 ASSERT_TRUE(WaitForExtensionCrash(extension_id));
78 ASSERT_FALSE( 79 ASSERT_FALSE(
79 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension)); 80 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension));
80 } 81 }
81 82
82 void CheckExtensionConsistency(size_t index) { 83 void CheckExtensionConsistency(size_t index) {
83 ASSERT_LT(index, GetExtensionService()->extensions()->size()); 84 ASSERT_LT(index, GetExtensionService()->extensions()->size());
84 const Extension* extension = 85 const Extension* extension =
85 GetExtensionService()->extensions()->at(index); 86 GetExtensionService()->extensions()->at(index);
86 ASSERT_TRUE(extension); 87 ASSERT_TRUE(extension);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 LoadSecondExtension(); 444 LoadSecondExtension();
444 CrashExtension(size_before); 445 CrashExtension(size_before);
445 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); 446 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size());
446 ASSERT_EQ(crash_size_before + 1, 447 ASSERT_EQ(crash_size_before + 1,
447 GetExtensionService()->terminated_extensions()->size()); 448 GetExtensionService()->terminated_extensions()->size());
448 449
449 GetExtensionService()->UnloadAllExtensions(); 450 GetExtensionService()->UnloadAllExtensions();
450 ASSERT_EQ(crash_size_before, 451 ASSERT_EQ(crash_size_before,
451 GetExtensionService()->terminated_extensions()->size()); 452 GetExtensionService()->terminated_extensions()->size());
452 } 453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698