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

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

Issue 2819086: Removal of TabContentsDelegate::GetBrowser() interface method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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 | Annotate | Revision Log
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"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Show the task manager. This populates the model, and helps with debugging 94 // Show the task manager. This populates the model, and helps with debugging
95 // (you see the task manager). 95 // (you see the task manager).
96 browser()->window()->ShowTaskManager(); 96 browser()->window()->ShowTaskManager();
97 97
98 // Browser and the New Tab Page. 98 // Browser and the New Tab Page.
99 EXPECT_EQ(2, model()->ResourceCount()); 99 EXPECT_EQ(2, model()->ResourceCount());
100 100
101 // Open a new tab and make sure we notice that. 101 // Open a new tab and make sure we notice that.
102 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), 102 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
103 FilePath(kTitle1File))); 103 FilePath(kTitle1File)));
104 Browser* browser_used = NULL;
104 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0, 105 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0,
105 TabStripModel::ADD_SELECTED, NULL, std::string()); 106 TabStripModel::ADD_SELECTED, NULL, std::string(),
107 &browser_used);
108 EXPECT_EQ(browser(), browser_used);
106 WaitForResourceChange(3); 109 WaitForResourceChange(3);
107 110
108 // Close the tab and verify that we notice. 111 // Close the tab and verify that we notice.
109 TabContents* first_tab = browser()->GetTabContentsAt(0); 112 TabContents* first_tab = browser()->GetTabContentsAt(0);
110 ASSERT_TRUE(first_tab); 113 ASSERT_TRUE(first_tab);
111 browser()->CloseTabContents(first_tab); 114 browser()->CloseTabContents(first_tab);
112 WaitForResourceChange(2); 115 WaitForResourceChange(2);
113 } 116 }
114 117
115 #if defined(OS_WIN) 118 #if defined(OS_WIN)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // (you see the task manager). 248 // (you see the task manager).
246 browser()->window()->ShowTaskManager(); 249 browser()->window()->ShowTaskManager();
247 250
248 // Browser and the New Tab Page. 251 // Browser and the New Tab Page.
249 EXPECT_EQ(2, model()->ResourceCount()); 252 EXPECT_EQ(2, model()->ResourceCount());
250 253
251 // Open a new tab and make sure we notice that. 254 // Open a new tab and make sure we notice that.
252 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory), 255 GURL url(ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
253 FilePath(kTitle1File))); 256 FilePath(kTitle1File)));
254 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0, 257 browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, 0,
255 TabStripModel::ADD_SELECTED, NULL, std::string()); 258 TabStripModel::ADD_SELECTED, NULL, std::string(),
259 NULL);
256 WaitForResourceChange(3); 260 WaitForResourceChange(3);
257 261
258 // Check that we get some value for the cache columns. 262 // Check that we get some value for the cache columns.
259 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), 263 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2),
260 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 264 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
261 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), 265 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
262 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 266 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
263 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), 267 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2),
264 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT)); 268 l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
265 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model_unittest.cc ('k') | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698