| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "chrome/browser/background/background_contents_service.h" | 10 #include "chrome/browser/background/background_contents_service.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 144 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
| 145 | 145 |
| 146 // Open a new panel to an extension url and make sure we notice that. | 146 // Open a new panel to an extension url and make sure we notice that. |
| 147 GURL url( | 147 GURL url( |
| 148 "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/french_sentence.html"); | 148 "chrome-extension://behllobkkfkfnphdnhnkndlbkcpglgmj/french_sentence.html"); |
| 149 Panel* panel = PanelManager::GetInstance()->CreatePanel( | 149 Panel* panel = PanelManager::GetInstance()->CreatePanel( |
| 150 web_app::GenerateApplicationNameFromExtensionId( | 150 web_app::GenerateApplicationNameFromExtensionId( |
| 151 last_loaded_extension_id_), | 151 last_loaded_extension_id_), |
| 152 browser()->profile(), | 152 browser()->profile(), |
| 153 url, | 153 url, |
| 154 gfx::Size(300, 400)); | 154 gfx::Rect(300, 400), |
| 155 PanelManager::CREATE_AS_DOCKED); |
| 155 TaskManagerBrowserTestUtil::WaitForResourceChange(4); | 156 TaskManagerBrowserTestUtil::WaitForResourceChange(4); |
| 156 | 157 |
| 157 // Check that the fourth entry is a resource with the panel's web contents | 158 // Check that the fourth entry is a resource with the panel's web contents |
| 158 // and whose title starts with "Extension:". | 159 // and whose title starts with "Extension:". |
| 159 ASSERT_EQ(panel->GetWebContents(), model()->GetResourceWebContents(3)); | 160 ASSERT_EQ(panel->GetWebContents(), model()->GetResourceWebContents(3)); |
| 160 string16 prefix = l10n_util::GetStringFUTF16( | 161 string16 prefix = l10n_util::GetStringFUTF16( |
| 161 IDS_TASK_MANAGER_EXTENSION_PREFIX, string16()); | 162 IDS_TASK_MANAGER_EXTENSION_PREFIX, string16()); |
| 162 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(3), prefix, true)); | 163 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(3), prefix, true)); |
| 163 | 164 |
| 164 // Close the panel and verify that we notice. | 165 // Close the panel and verify that we notice. |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 TaskManagerBrowserTestUtil::WaitForResourceChange(3); | 534 TaskManagerBrowserTestUtil::WaitForResourceChange(3); |
| 534 | 535 |
| 535 // Check that we get some value for the cache columns. | 536 // Check that we get some value for the cache columns. |
| 536 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), | 537 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), |
| 537 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 538 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 538 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), | 539 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), |
| 539 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 540 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 540 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), | 541 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), |
| 541 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); | 542 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); |
| 542 } | 543 } |
| OLD | NEW |