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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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) 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 10 matching lines...) Expand all
21 #include "chrome/browser/tabs/tab_strip_model.h" 21 #include "chrome/browser/tabs/tab_strip_model.h"
22 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" 22 #include "chrome/browser/task_manager/task_manager_browsertest_util.h"
23 #include "chrome/browser/ui/browser.h" 23 #include "chrome/browser/ui/browser.h"
24 #include "chrome/browser/ui/browser_navigator.h" 24 #include "chrome/browser/ui/browser_navigator.h"
25 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
27 #include "chrome/common/chrome_notification_types.h" 27 #include "chrome/common/chrome_notification_types.h"
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/common/page_transition_types.h" 32 #include "content/public/common/page_transition_types.h"
32 #include "grit/generated_resources.h" 33 #include "grit/generated_resources.h"
33 #include "net/base/mock_host_resolver.h" 34 #include "net/base/mock_host_resolver.h"
34 #include "testing/gtest/include/gtest/gtest.h" 35 #include "testing/gtest/include/gtest/gtest.h"
35 #include "ui/base/l10n/l10n_util.h" 36 #include "ui/base/l10n/l10n_util.h"
36 37
37 // On Linux this is crashing intermittently http://crbug/84719 38 // On Linux this is crashing intermittently http://crbug/84719
38 // In some environments this test fails about 1/6 http://crbug/84850 39 // In some environments this test fails about 1/6 http://crbug/84850
39 #if defined(OS_LINUX) 40 #if defined(OS_LINUX)
40 #define MAYBE_KillExtension DISABLED_KillExtension 41 #define MAYBE_KillExtension DISABLED_KillExtension
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 std::string host_str("localhost"); // must stay in scope with replace_host 296 std::string host_str("localhost"); // must stay in scope with replace_host
296 replace_host.SetHostStr(host_str); 297 replace_host.SetHostStr(host_str);
297 GURL base_url = test_server()->GetURL( 298 GURL base_url = test_server()->GetURL(
298 "files/extensions/api_test/app_process/"); 299 "files/extensions/api_test/app_process/");
299 base_url = base_url.ReplaceComponents(replace_host); 300 base_url = base_url.ReplaceComponents(replace_host);
300 301
301 // Open a new tab to an app URL before the app is loaded. 302 // Open a new tab to an app URL before the app is loaded.
302 GURL url(base_url.Resolve("path1/empty.html")); 303 GURL url(base_url.Resolve("path1/empty.html"));
303 ui_test_utils::WindowedNotificationObserver observer( 304 ui_test_utils::WindowedNotificationObserver observer(
304 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 305 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
305 NotificationService::AllSources()); 306 content::NotificationService::AllSources());
306 AddTabAtIndex(0, url, content::PAGE_TRANSITION_TYPED); 307 AddTabAtIndex(0, url, content::PAGE_TRANSITION_TYPED);
307 observer.Wait(); 308 observer.Wait();
308 309
309 // Check that the third entry's title starts with "Tab:". 310 // Check that the third entry's title starts with "Tab:".
310 string16 tab_prefix = l10n_util::GetStringFUTF16( 311 string16 tab_prefix = l10n_util::GetStringFUTF16(
311 IDS_TASK_MANAGER_TAB_PREFIX, string16()); 312 IDS_TASK_MANAGER_TAB_PREFIX, string16());
312 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), tab_prefix, true)); 313 ASSERT_TRUE(StartsWith(model()->GetResourceTitle(2), tab_prefix, true));
313 314
314 // Load the hosted app and make sure it still starts with "Tab:", 315 // Load the hosted app and make sure it still starts with "Tab:",
315 // since it hasn't changed to an app process yet. 316 // since it hasn't changed to an app process yet.
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 TaskManagerBrowserTestUtil::WaitForResourceChange(3); 464 TaskManagerBrowserTestUtil::WaitForResourceChange(3);
464 465
465 // Check that we get some value for the cache columns. 466 // Check that we get some value for the cache columns.
466 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2), 467 DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2),
467 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 468 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
468 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2), 469 DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
469 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 470 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
470 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2), 471 DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2),
471 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT)); 472 l10n_util::GetStringUTF16(IDS_TASK_MANAGER_NA_CELL_TEXT));
472 } 473 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/task_manager/task_manager_notification_resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698