OLD | NEW |
1 // Copyright (c) 2010 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 "chrome/browser/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 // Kill the extension process and make sure we notice it. | 380 // Kill the extension process and make sure we notice it. |
381 TaskManager::GetInstance()->KillProcess(2); | 381 TaskManager::GetInstance()->KillProcess(2); |
382 WaitForResourceChange(2); | 382 WaitForResourceChange(2); |
383 | 383 |
384 // Reload the extension using the "crashed extension" infobar while the task | 384 // Reload the extension using the "crashed extension" infobar while the task |
385 // manager is still visible. Make sure we don't crash and the extension | 385 // manager is still visible. Make sure we don't crash and the extension |
386 // gets reloaded and noticed in the task manager. | 386 // gets reloaded and noticed in the task manager. |
387 TabContents* current_tab = browser()->GetSelectedTabContents(); | 387 TabContents* current_tab = browser()->GetSelectedTabContents(); |
388 ASSERT_EQ(1, current_tab->infobar_delegate_count()); | 388 ASSERT_EQ(1, current_tab->infobar_delegate_count()); |
389 InfoBarDelegate* delegate = current_tab->GetInfoBarDelegateAt(0); | 389 ConfirmInfoBarDelegate* delegate = |
390 CrashedExtensionInfoBarDelegate* crashed_delegate = | 390 current_tab->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); |
391 delegate->AsCrashedExtensionInfoBarDelegate(); | 391 ASSERT_TRUE(delegate); |
392 ASSERT_TRUE(crashed_delegate); | 392 delegate->Accept(); |
393 crashed_delegate->Accept(); | |
394 WaitForResourceChange(3); | 393 WaitForResourceChange(3); |
395 } | 394 } |
396 | 395 |
397 // Regression test for http://crbug.com/18693. | 396 // Regression test for http://crbug.com/18693. |
398 // | 397 // |
399 // This test is crashy. See http://crbug.com/42315. | 398 // This test is crashy. See http://crbug.com/42315. |
400 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_ReloadExtension) { | 399 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, DISABLED_ReloadExtension) { |
401 // Show the task manager. This populates the model, and helps with debugging | 400 // Show the task manager. This populates the model, and helps with debugging |
402 // (you see the task manager). | 401 // (you see the task manager). |
403 browser()->window()->ShowTaskManager(); | 402 browser()->window()->ShowTaskManager(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 WaitForResourceChange(3); | 455 WaitForResourceChange(3); |
457 | 456 |
458 // Check that we get some value for the cache columns. | 457 // Check that we get some value for the cache columns. |
459 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 458 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
460 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 459 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
461 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 460 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
462 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 461 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
463 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 462 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
464 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 463 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
465 } | 464 } |
OLD | NEW |