| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ui/message_center/message_center.h" | 30 #include "ui/message_center/message_center.h" |
| 31 #include "ui/message_center/notification_list.h" | 31 #include "ui/message_center/notification_list.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 using content::NavigationController; | 34 using content::NavigationController; |
| 35 using content::WebContents; | 35 using content::WebContents; |
| 36 using extensions::Extension; | 36 using extensions::Extension; |
| 37 | 37 |
| 38 // Tests are timing out waiting for extension to crash. | 38 // Tests are timing out waiting for extension to crash. |
| 39 // http://crbug.com/174705 | 39 // http://crbug.com/174705 |
| 40 #if defined(OS_MAC) || defined(USE_AURA) | 40 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 41 #define MAYBE_ExtensionCrashRecoveryTest DISABLED_ExtensionCrashRecoveryTest | 41 #define MAYBE_ExtensionCrashRecoveryTest DISABLED_ExtensionCrashRecoveryTest |
| 42 #else | 42 #else |
| 43 #define MAYBE_ExtensionCrashRecoveryTest ExtensionCrashRecoveryTest | 43 #define MAYBE_ExtensionCrashRecoveryTest ExtensionCrashRecoveryTest |
| 44 #endif // defined(OS_MAC) || defined(USE_AURA) | 44 #endif // defined(OS_MAC) || defined(USE_AURA) |
| 45 | 45 |
| 46 class ExtensionCrashRecoveryTestBase : public ExtensionBrowserTest { | 46 class ExtensionCrashRecoveryTestBase : public ExtensionBrowserTest { |
| 47 protected: | 47 protected: |
| 48 virtual void AcceptNotification(size_t index) = 0; | 48 virtual void AcceptNotification(size_t index) = 0; |
| 49 virtual void CancelNotification(size_t index) = 0; | 49 virtual void CancelNotification(size_t index) = 0; |
| 50 virtual size_t CountBalloons() = 0; | 50 virtual size_t CountBalloons() = 0; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ASSERT_TRUE(extension); | 108 ASSERT_TRUE(extension); |
| 109 second_extension_id_ = extension->id(); | 109 second_extension_id_ = extension->id(); |
| 110 CheckExtensionConsistency(second_extension_id_); | 110 CheckExtensionConsistency(second_extension_id_); |
| 111 } | 111 } |
| 112 | 112 |
| 113 std::string first_extension_id_; | 113 std::string first_extension_id_; |
| 114 std::string second_extension_id_; | 114 std::string second_extension_id_; |
| 115 | 115 |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 #if defined(ENABLE_MESSAGE_CENTER) | 118 // TODO(rsesek): Implement and enable these tests. http://crbug.com/179904 |
| 119 #if defined(ENABLE_MESSAGE_CENTER) && !defined(OS_MACOSX) |
| 119 | 120 |
| 120 class MessageCenterExtensionCrashRecoveryTest | 121 class MessageCenterExtensionCrashRecoveryTest |
| 121 : public ExtensionCrashRecoveryTestBase { | 122 : public ExtensionCrashRecoveryTestBase { |
| 122 protected: | 123 protected: |
| 123 virtual void AcceptNotification(size_t index) { | 124 virtual void AcceptNotification(size_t index) { |
| 124 message_center::MessageCenter* message_center = | 125 message_center::MessageCenter* message_center = |
| 125 message_center::MessageCenter::Get(); | 126 message_center::MessageCenter::Get(); |
| 126 ASSERT_GT(message_center->NotificationCount(), index); | 127 ASSERT_GT(message_center->NotificationCount(), index); |
| 127 message_center::NotificationList::Notifications::reverse_iterator it = | 128 message_center::NotificationList::Notifications::reverse_iterator it = |
| 128 message_center->notification_list()->GetNotifications().rbegin(); | 129 message_center->notification_list()->GetNotifications().rbegin(); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 GetController())); | 573 GetController())); |
| 573 chrome::Reload(browser(), CURRENT_TAB); | 574 chrome::Reload(browser(), CURRENT_TAB); |
| 574 observer.Wait(); | 575 observer.Wait(); |
| 575 } | 576 } |
| 576 // Extension should now be loaded. | 577 // Extension should now be loaded. |
| 577 SCOPED_TRACE("after reloading the tab"); | 578 SCOPED_TRACE("after reloading the tab"); |
| 578 CheckExtensionConsistency(first_extension_id_); | 579 CheckExtensionConsistency(first_extension_id_); |
| 579 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); | 580 ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); |
| 580 ASSERT_EQ(0U, CountBalloons()); | 581 ASSERT_EQ(0U, CountBalloons()); |
| 581 } | 582 } |
| OLD | NEW |