| 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 "chrome/browser/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 #include "chrome/browser/extensions/extension_install_ui.h" | 6 #include "chrome/browser/extensions/extension_install_ui.h" |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
| 10 #include "chrome/browser/themes/theme_service_factory.h" | 10 #include "chrome/browser/themes/theme_service_factory.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 17 #include "chrome/test/base/in_process_browser_test.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
| 18 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
| 19 #include "chrome/test/ui/ui_test.h" | 19 #include "chrome/test/ui/ui_test.h" |
| 20 #include "net/test/test_server.h" | 20 #include "net/test/test_server.h" |
| 21 | 21 |
| 22 class InfoBarsTest : public InProcessBrowserTest { | 22 class InfoBarsTest : public InProcessBrowserTest { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 ui_test_utils::WindowedNotificationObserver infobar_added_2( | 66 ui_test_utils::WindowedNotificationObserver infobar_added_2( |
| 67 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 67 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
| 68 content::NotificationService::AllSources()); | 68 content::NotificationService::AllSources()); |
| 69 ui_test_utils::WindowedNotificationObserver infobar_removed_1( | 69 ui_test_utils::WindowedNotificationObserver infobar_removed_1( |
| 70 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 70 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 71 content::NotificationService::AllSources()); | 71 content::NotificationService::AllSources()); |
| 72 InstallExtension("theme2.crx"); | 72 InstallExtension("theme2.crx"); |
| 73 infobar_added_2.Wait(); | 73 infobar_added_2.Wait(); |
| 74 infobar_removed_1.Wait(); | 74 infobar_removed_1.Wait(); |
| 75 EXPECT_EQ(0u, | 75 EXPECT_EQ(0u, |
| 76 browser()->GetTabContentsWrapperAt(0)->infobar_tab_helper()-> | 76 browser()->GetTabContentsAt(0)->infobar_tab_helper()-> |
| 77 infobar_count()); | 77 infobar_count()); |
| 78 | 78 |
| 79 ui_test_utils::WindowedNotificationObserver infobar_removed_2( | 79 ui_test_utils::WindowedNotificationObserver infobar_removed_2( |
| 80 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 80 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 81 content::NotificationService::AllSources()); | 81 content::NotificationService::AllSources()); |
| 82 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 82 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
| 83 infobar_removed_2.Wait(); | 83 infobar_removed_2.Wait(); |
| 84 EXPECT_EQ(0u, | 84 EXPECT_EQ(0u, |
| 85 browser()->GetSelectedTabContentsWrapper()->infobar_tab_helper()-> | 85 browser()->GetActiveTabContents()->infobar_tab_helper()-> |
| 86 infobar_count()); | 86 infobar_count()); |
| 87 } | 87 } |
| OLD | NEW |