| OLD | NEW |
| 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 "chrome/browser/task_manager/task_manager.h" | 5 #include "chrome/browser/task_manager/task_manager.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/background/background_contents_service.h" | 9 #include "chrome/browser/background/background_contents_service.h" |
| 10 #include "chrome/browser/background/background_contents_service_factory.h" | 10 #include "chrome/browser/background/background_contents_service_factory.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 // gets reloaded and noticed in the task manager. | 375 // gets reloaded and noticed in the task manager. |
| 376 TabContentsWrapper* current_tab = browser()->GetSelectedTabContentsWrapper(); | 376 TabContentsWrapper* current_tab = browser()->GetSelectedTabContentsWrapper(); |
| 377 ASSERT_EQ(1U, current_tab->infobar_count()); | 377 ASSERT_EQ(1U, current_tab->infobar_count()); |
| 378 ConfirmInfoBarDelegate* delegate = | 378 ConfirmInfoBarDelegate* delegate = |
| 379 current_tab->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); | 379 current_tab->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); |
| 380 ASSERT_TRUE(delegate); | 380 ASSERT_TRUE(delegate); |
| 381 delegate->Accept(); | 381 delegate->Accept(); |
| 382 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 382 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
| 383 } | 383 } |
| 384 | 384 |
| 385 #if defined(OS_WIN) |
| 386 // Bug 93158. |
| 387 #define MAYBE_ReloadExtension FLAKY_ReloadExtension |
| 388 #else |
| 389 #define MAYBE_ReloadExtension ReloadExtension |
| 390 #endif |
| 391 |
| 385 // Regression test for http://crbug.com/18693. | 392 // Regression test for http://crbug.com/18693. |
| 386 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, ReloadExtension) { | 393 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, MAYBE_ReloadExtension) { |
| 387 // Show the task manager. This populates the model, and helps with debugging | 394 // Show the task manager. This populates the model, and helps with debugging |
| 388 // (you see the task manager). | 395 // (you see the task manager). |
| 389 browser()->window()->ShowTaskManager(); | 396 browser()->window()->ShowTaskManager(); |
| 390 | 397 |
| 391 LOG(INFO) << "loading extension"; | 398 LOG(INFO) << "loading extension"; |
| 392 ASSERT_TRUE(LoadExtension( | 399 ASSERT_TRUE(LoadExtension( |
| 393 test_data_dir_.AppendASCII("common").AppendASCII("background_page"))); | 400 test_data_dir_.AppendASCII("common").AppendASCII("background_page"))); |
| 394 | 401 |
| 395 // Wait until we see the loaded extension in the task manager (the three | 402 // Wait until we see the loaded extension in the task manager (the three |
| 396 // resources are: the browser process, New Tab Page, and the extension). | 403 // resources are: the browser process, New Tab Page, and the extension). |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 449 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
| 443 | 450 |
| 444 // Check that we get some value for the cache columns. | 451 // Check that we get some value for the cache columns. |
| 445 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 452 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
| 446 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 453 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 447 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 454 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
| 448 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 455 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 449 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 456 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
| 450 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 457 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 451 } | 458 } |
| OLD | NEW |