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

Side by Side Diff: chrome/browser/extensions/api/extension_action/browser_action_apitest.cc

Issue 11246003: Remove Profile->GetExtensionProcessManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix extension_crash_recovery_browsertest Created 8 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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
11 #include "chrome/browser/extensions/browser_action_test_util.h" 11 #include "chrome/browser/extensions/browser_action_test_util.h"
12 #include "chrome/browser/extensions/extension_action.h" 12 #include "chrome/browser/extensions/extension_action.h"
13 #include "chrome/browser/extensions/extension_action_icon_factory.h" 13 #include "chrome/browser/extensions/extension_action_icon_factory.h"
14 #include "chrome/browser/extensions/extension_action_manager.h" 14 #include "chrome/browser/extensions/extension_action_manager.h"
15 #include "chrome/browser/extensions/extension_apitest.h" 15 #include "chrome/browser/extensions/extension_apitest.h"
16 #include "chrome/browser/extensions/extension_service.h" 16 #include "chrome/browser/extensions/extension_service.h"
17 #include "chrome/browser/extensions/extension_system.h"
17 #include "chrome/browser/extensions/extension_tab_util.h" 18 #include "chrome/browser/extensions/extension_tab_util.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
20 #include "chrome/browser/ui/browser_commands.h" 21 #include "chrome/browser/ui/browser_commands.h"
21 #include "chrome/browser/ui/browser_tabstrip.h" 22 #include "chrome/browser/ui/browser_tabstrip.h"
22 #include "chrome/browser/ui/browser_window.h" 23 #include "chrome/browser/ui/browser_window.h"
23 #include "chrome/common/chrome_notification_types.h" 24 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/url_constants.h" 25 #include "chrome/common/url_constants.h"
25 #include "chrome/test/base/ui_test_utils.h" 26 #include "chrome/test/base/ui_test_utils.h"
26 #include "content/public/browser/notification_service.h" 27 #include "content/public/browser/notification_service.h"
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 565
565 // Disabled because of failures (crashes) on ASAN bot. 566 // Disabled because of failures (crashes) on ASAN bot.
566 // See http://crbug.com/98861. 567 // See http://crbug.com/98861.
567 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_CloseBackgroundPage) { 568 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_CloseBackgroundPage) {
568 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII( 569 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII(
569 "browser_action/close_background"))); 570 "browser_action/close_background")));
570 const Extension* extension = GetSingleLoadedExtension(); 571 const Extension* extension = GetSingleLoadedExtension();
571 572
572 // There is a background page and a browser action with no badge text. 573 // There is a background page and a browser action with no badge text.
573 ExtensionProcessManager* manager = 574 ExtensionProcessManager* manager =
574 browser()->profile()->GetExtensionProcessManager(); 575 extensions::ExtensionSystem::Get(browser()->profile())->process_manager();
575 ASSERT_TRUE(manager->GetBackgroundHostForExtension(extension->id())); 576 ASSERT_TRUE(manager->GetBackgroundHostForExtension(extension->id()));
576 ExtensionAction* action = GetBrowserAction(*extension); 577 ExtensionAction* action = GetBrowserAction(*extension);
577 ASSERT_EQ("", action->GetBadgeText(ExtensionAction::kDefaultTabId)); 578 ASSERT_EQ("", action->GetBadgeText(ExtensionAction::kDefaultTabId));
578 579
579 content::WindowedNotificationObserver host_destroyed_observer( 580 content::WindowedNotificationObserver host_destroyed_observer(
580 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, 581 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED,
581 content::NotificationService::AllSources()); 582 content::NotificationService::AllSources());
582 583
583 // Click the browser action. 584 // Click the browser action.
584 browser()->profile()->GetExtensionService()->toolbar_model()-> 585 browser()->profile()->GetExtensionService()->toolbar_model()->
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 ASSERT_TRUE(catcher.GetNextResult()); 641 ASSERT_TRUE(catcher.GetNextResult());
641 642
642 // Test the getters for a specific tab. 643 // Test the getters for a specific tab.
643 ui_test_utils::NavigateToURL(browser(), 644 ui_test_utils::NavigateToURL(browser(),
644 GURL(extension->GetResourceURL("update2.html"))); 645 GURL(extension->GetResourceURL("update2.html")));
645 ASSERT_TRUE(catcher.GetNextResult()); 646 ASSERT_TRUE(catcher.GetNextResult());
646 } 647 }
647 648
648 } // namespace 649 } // namespace
649 } // namespace extensions 650 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/alert_apitest.cc ('k') | chrome/browser/extensions/api/management/management_api_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698