OLD | NEW |
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 "base/process_util.h" | 5 #include "base/process_util.h" |
6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
7 #include "chrome/browser/extensions/extension_browsertest.h" | 7 #include "chrome/browser/extensions/extension_browsertest.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/extension_system.h" |
11 #include "chrome/browser/notifications/balloon.h" | 12 #include "chrome/browser/notifications/balloon.h" |
12 #include "chrome/browser/notifications/balloon_collection.h" | 13 #include "chrome/browser/notifications/balloon_collection.h" |
13 #include "chrome/browser/notifications/balloon_host.h" | 14 #include "chrome/browser/notifications/balloon_host.h" |
14 #include "chrome/browser/notifications/notification.h" | 15 #include "chrome/browser/notifications/notification.h" |
15 #include "chrome/browser/notifications/notification_delegate.h" | 16 #include "chrome/browser/notifications/notification_delegate.h" |
16 #include "chrome/browser/notifications/notification_ui_manager.h" | 17 #include "chrome/browser/notifications/notification_ui_manager.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_commands.h" | 20 #include "chrome/browser/ui/browser_commands.h" |
20 #include "chrome/browser/ui/browser_tabstrip.h" | 21 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 10 matching lines...) Expand all Loading... |
31 using content::WebContents; | 32 using content::WebContents; |
32 using extensions::Extension; | 33 using extensions::Extension; |
33 | 34 |
34 class ExtensionCrashRecoveryTest : public ExtensionBrowserTest { | 35 class ExtensionCrashRecoveryTest : public ExtensionBrowserTest { |
35 protected: | 36 protected: |
36 ExtensionService* GetExtensionService() { | 37 ExtensionService* GetExtensionService() { |
37 return browser()->profile()->GetExtensionService(); | 38 return browser()->profile()->GetExtensionService(); |
38 } | 39 } |
39 | 40 |
40 ExtensionProcessManager* GetExtensionProcessManager() { | 41 ExtensionProcessManager* GetExtensionProcessManager() { |
41 return browser()->profile()->GetExtensionProcessManager(); | 42 return extensions::ExtensionSystem::Get(browser()->profile())-> |
| 43 process_manager(); |
42 } | 44 } |
43 | 45 |
44 Balloon* GetNotificationDelegate(size_t index) { | 46 Balloon* GetNotificationDelegate(size_t index) { |
45 NotificationUIManager* manager = | 47 NotificationUIManager* manager = |
46 g_browser_process->notification_ui_manager(); | 48 g_browser_process->notification_ui_manager(); |
47 BalloonCollection::Balloons balloons = | 49 BalloonCollection::Balloons balloons = |
48 manager->balloon_collection()->GetActiveBalloons(); | 50 manager->balloon_collection()->GetActiveBalloons(); |
49 return balloons.at(index); | 51 return balloons.at(index); |
50 } | 52 } |
51 | 53 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 &chrome::GetActiveWebContents(browser())->GetController())); | 489 &chrome::GetActiveWebContents(browser())->GetController())); |
488 chrome::Reload(browser(), CURRENT_TAB); | 490 chrome::Reload(browser(), CURRENT_TAB); |
489 observer.Wait(); | 491 observer.Wait(); |
490 } | 492 } |
491 // Extension should now be loaded. | 493 // Extension should now be loaded. |
492 SCOPED_TRACE("after reloading the tab"); | 494 SCOPED_TRACE("after reloading the tab"); |
493 CheckExtensionConsistency(first_extension_id_); | 495 CheckExtensionConsistency(first_extension_id_); |
494 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); | 496 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); |
495 ASSERT_EQ(0U, CountBalloons()); | 497 ASSERT_EQ(0U, CountBalloons()); |
496 } | 498 } |
OLD | NEW |