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