| OLD | NEW |
| 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/extensions/crashed_extension_infobar.h" | 6 #include "chrome/browser/extensions/crashed_extension_infobar.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/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 GetExtensionsService()->extensions()->at(index); | 55 GetExtensionsService()->extensions()->at(index); |
| 56 ASSERT_TRUE(extension); | 56 ASSERT_TRUE(extension); |
| 57 std::string extension_id(extension->id()); | 57 std::string extension_id(extension->id()); |
| 58 ExtensionHost* extension_host = | 58 ExtensionHost* extension_host = |
| 59 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension); | 59 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension); |
| 60 ASSERT_TRUE(extension_host); | 60 ASSERT_TRUE(extension_host); |
| 61 | 61 |
| 62 RenderProcessHost* extension_rph = | 62 RenderProcessHost* extension_rph = |
| 63 extension_host->render_view_host()->process(); | 63 extension_host->render_view_host()->process(); |
| 64 base::KillProcess(extension_rph->GetHandle(), | 64 base::KillProcess(extension_rph->GetHandle(), |
| 65 base::PROCESS_END_KILLED_BY_USER, false); | 65 base::EXIT_CODE_PROCESS_WAS_KILLED, false); |
| 66 ASSERT_TRUE(WaitForExtensionCrash(extension_id)); | 66 ASSERT_TRUE(WaitForExtensionCrash(extension_id)); |
| 67 ASSERT_FALSE( | 67 ASSERT_FALSE( |
| 68 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension)); | 68 GetExtensionProcessManager()->GetBackgroundHostForExtension(extension)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void CheckExtensionConsistency(size_t index) { | 71 void CheckExtensionConsistency(size_t index) { |
| 72 ASSERT_LT(index, GetExtensionsService()->extensions()->size()); | 72 ASSERT_LT(index, GetExtensionsService()->extensions()->size()); |
| 73 const Extension* extension = | 73 const Extension* extension = |
| 74 GetExtensionsService()->extensions()->at(index); | 74 GetExtensionsService()->extensions()->at(index); |
| 75 ASSERT_TRUE(extension); | 75 ASSERT_TRUE(extension); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 CheckExtensionConsistency(size_before); | 287 CheckExtensionConsistency(size_before); |
| 288 } | 288 } |
| 289 | 289 |
| 290 { | 290 { |
| 291 SCOPED_TRACE("second: infobar"); | 291 SCOPED_TRACE("second: infobar"); |
| 292 AcceptCrashedExtensionInfobar(0); | 292 AcceptCrashedExtensionInfobar(0); |
| 293 CheckExtensionConsistency(size_before); | 293 CheckExtensionConsistency(size_before); |
| 294 CheckExtensionConsistency(size_before + 1); | 294 CheckExtensionConsistency(size_before + 1); |
| 295 } | 295 } |
| 296 } | 296 } |
| OLD | NEW |