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

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

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/browser/ui/browser.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) 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 17 matching lines...) Expand all
28 #include "chrome/common/extensions/extension.h" 28 #include "chrome/common/extensions/extension.h"
29 #include "chrome/test/base/in_process_browser_test.h" 29 #include "chrome/test/base/in_process_browser_test.h"
30 #include "chrome/test/base/ui_test_utils.h" 30 #include "chrome/test/base/ui_test_utils.h"
31 #include "content/public/browser/notification_service.h" 31 #include "content/public/browser/notification_service.h"
32 #include "content/public/common/page_transition_types.h" 32 #include "content/public/common/page_transition_types.h"
33 #include "grit/generated_resources.h" 33 #include "grit/generated_resources.h"
34 #include "net/base/mock_host_resolver.h" 34 #include "net/base/mock_host_resolver.h"
35 #include "testing/gtest/include/gtest/gtest.h" 35 #include "testing/gtest/include/gtest/gtest.h"
36 #include "ui/base/l10n/l10n_util.h" 36 #include "ui/base/l10n/l10n_util.h"
37 37
38 using content::WebContents;
39
38 // On Linux this is crashing intermittently http://crbug/84719 40 // On Linux this is crashing intermittently http://crbug/84719
39 // In some environments this test fails about 1/6 http://crbug/84850 41 // In some environments this test fails about 1/6 http://crbug/84850
40 #if defined(OS_LINUX) 42 #if defined(OS_LINUX)
41 #define MAYBE_KillExtension DISABLED_KillExtension 43 #define MAYBE_KillExtension DISABLED_KillExtension
42 #else 44 #else
43 #define MAYBE_KillExtension KillExtension 45 #define MAYBE_KillExtension KillExtension
44 #endif 46 #endif
45 47
46 namespace { 48 namespace {
47 49
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 88 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
87 89
88 // Check that the third entry is a tab contents resource whose title starts 90 // Check that the third entry is a tab contents resource whose title starts
89 // starts with "Tab:". 91 // starts with "Tab:".
90 ASSERT_TRUE(model()->GetResourceTabContents(2) != NULL); 92 ASSERT_TRUE(model()->GetResourceTabContents(2) != NULL);
91 string16 prefix = l10n_util::GetStringFUTF16( 93 string16 prefix = l10n_util::GetStringFUTF16(
92 IDS_TASK_MANAGER_TAB_PREFIX, string16()); 94 IDS_TASK_MANAGER_TAB_PREFIX, string16());
93 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true)); 95 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), prefix, true));
94 96
95 // Close the tab and verify that we notice. 97 // Close the tab and verify that we notice.
96 TabContents* first_tab = browser()->GetTabContentsAt(0); 98 WebContents* first_tab =
99 browser()->GetTabContentsWrapperAt(0)->web_contents();
97 ASSERT_TRUE(first_tab); 100 ASSERT_TRUE(first_tab);
98 browser()->CloseTabContents(first_tab); 101 browser()->CloseTabContents(first_tab);
99 TaskManagerBrowserTestUtil::WaitForResourceChange(2); 102 TaskManagerBrowserTestUtil::WaitForResourceChange(2);
100 } 103 }
101 104
102 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeBGContentsChanges) { 105 IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeBGContentsChanges) {
103 EXPECT_EQ(0, model()->ResourceCount()); 106 EXPECT_EQ(0, model()->ResourceCount());
104 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount()); 107 EXPECT_EQ(0, TaskManager::GetBackgroundPageCount());
105 108
106 // Show the task manager. This populates the model, and helps with debugging 109 // Show the task manager. This populates the model, and helps with debugging
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 465 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
463 466
464 // Check that we get some value for the cache columns. 467 // Check that we get some value for the cache columns.
465 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), 468 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2),
466 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 469 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
467 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), 470 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
468 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 471 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
469 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), 472 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2),
470 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 473 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
471 } 474 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.cc ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698