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

Side by Side Diff: chrome/browser/task_manager_browsertest.cc

Issue 2856091: Fix some problems with TaskManagerBrowserTest.PopulateWebCacheFields: (Closed)
Patch Set: memset Created 10 years, 4 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
« no previous file with comments | « chrome/browser/task_manager.cc ('k') | chrome/browser/task_manager_resource_providers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/task_manager.h" 5 #include "chrome/browser/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 "chrome/browser/browser.h" 9 #include "chrome/browser/browser.h"
10 #include "chrome/browser/browser_window.h" 10 #include "chrome/browser/browser_window.h"
11 #include "chrome/browser/extensions/crashed_extension_infobar.h" 11 #include "chrome/browser/extensions/crashed_extension_infobar.h"
12 #include "chrome/browser/extensions/extension_browsertest.h" 12 #include "chrome/browser/extensions/extension_browsertest.h"
13 #include "chrome/browser/tab_contents/infobar_delegate.h" 13 #include "chrome/browser/tab_contents/infobar_delegate.h"
14 #include "chrome/browser/tab_contents/tab_contents.h" 14 #include "chrome/browser/tab_contents/tab_contents.h"
15 #include "chrome/common/extensions/extension.h" 15 #include "chrome/common/extensions/extension.h"
16 #include "chrome/common/notification_type.h"
16 #include "chrome/common/page_transition_types.h" 17 #include "chrome/common/page_transition_types.h"
17 #include "chrome/test/in_process_browser_test.h" 18 #include "chrome/test/in_process_browser_test.h"
18 #include "chrome/test/ui_test_utils.h" 19 #include "chrome/test/ui_test_utils.h"
19 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 22
22 namespace { 23 namespace {
23 24
24 const FilePath::CharType* kTitle1File = FILE_PATH_LITERAL("title1.html"); 25 const FilePath::CharType* kTitle1File = FILE_PATH_LITERAL("title1.html");
25 26
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 extension = model()->GetResourceExtension(2); 229 extension = model()->GetResourceExtension(2);
229 230
230 ReloadExtension(extension->id()); 231 ReloadExtension(extension->id());
231 WaitForResourceChange(3); 232 WaitForResourceChange(3);
232 extension = model()->GetResourceExtension(2); 233 extension = model()->GetResourceExtension(2);
233 234
234 ReloadExtension(extension->id()); 235 ReloadExtension(extension->id());
235 WaitForResourceChange(3); 236 WaitForResourceChange(3);
236 } 237 }
237 238
238 // Crashy, http://crbug.com/42301. 239 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, PopulateWebCacheFields) {
239 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest,
240 DISABLED_PopulateWebCacheFields) {
241 EXPECT_EQ(0, model()->ResourceCount()); 240 EXPECT_EQ(0, model()->ResourceCount());
242 241
243 // Show the task manager. This populates the model, and helps with debugging 242 // Show the task manager. This populates the model, and helps with debugging
244 // (you see the task manager). 243 // (you see the task manager).
245 browser()->window()->ShowTaskManager(); 244 browser()->window()->ShowTaskManager();
246 245
247 // Browser and the New Tab Page. 246 // Browser and the New Tab Page.
248 EXPECT_EQ(2, model()->ResourceCount()); 247 EXPECT_EQ(2, model()->ResourceCount());
249 248
250 // Open a new tab and make sure we notice that. 249 // Open a new tab and make sure we notice that.
251 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), 250 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
252 FilePath(kTitle1File))); 251 FilePath(kTitle1File)));
253 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0, 252 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0,
254 TabStripModel::ADD_SELECTED, NULL, std::string()); 253 TabStripModel::ADD_SELECTED, NULL, std::string());
255 WaitForResourceChange(3); 254 WaitForResourceChange(3);
256 255
256 // Make sure that we have received updated stats from the renderer. An update
257 // could be pending before we added the new tab, so wait for two updates.
258 // This way at least one of them must have occurred after adding the tab.
259 ui_test_utils::WaitForNotification(
260 NotificationType::TASK_MANAGER_RESOURCE_TYPE_STATS_UPDATED);
261 ui_test_utils::WaitForNotification(
262 NotificationType::TASK_MANAGER_RESOURCE_TYPE_STATS_UPDATED);
263
257 // Check that we get some value for the cache columns. 264 // Check that we get some value for the cache columns.
258 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), 265 EXPECT_NE(model()->GetResourceWebCoreImageCacheSize(2),
259 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 266 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
260 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), 267 EXPECT_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
261 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 268 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
262 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), 269 EXPECT_NE(model()->GetResourceWebCoreCSSCacheSize(2),
263 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 270 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
264 } 271 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager.cc ('k') | chrome/browser/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698