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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/crx_installer.h" | 10 #include "chrome/browser/extensions/crx_installer.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 browser(), embedded_test_server()->GetURL("/simple.html"), | 69 browser(), embedded_test_server()->GetURL("/simple.html"), |
70 WindowOpenDisposition::NEW_FOREGROUND_TAB, | 70 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
71 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 71 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
72 content::WindowedNotificationObserver infobar_added_2( | 72 content::WindowedNotificationObserver infobar_added_2( |
73 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 73 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
74 content::NotificationService::AllSources()); | 74 content::NotificationService::AllSources()); |
75 content::WindowedNotificationObserver infobar_removed_1( | 75 content::WindowedNotificationObserver infobar_removed_1( |
76 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 76 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
77 content::NotificationService::AllSources()); | 77 content::NotificationService::AllSources()); |
78 InstallExtension("theme2.crx"); | 78 InstallExtension("theme2.crx"); |
| 79 infobar_added_2.Wait(); |
79 infobar_removed_1.Wait(); | 80 infobar_removed_1.Wait(); |
80 infobar_added_2.Wait(); | |
81 EXPECT_EQ( | 81 EXPECT_EQ( |
82 0u, | 82 0u, |
83 InfoBarService::FromWebContents( | 83 InfoBarService::FromWebContents( |
84 browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); | 84 browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
85 | 85 |
86 content::WindowedNotificationObserver infobar_removed_2( | 86 content::WindowedNotificationObserver infobar_removed_2( |
87 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 87 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
88 content::NotificationService::AllSources()); | 88 content::NotificationService::AllSources()); |
89 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 89 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
90 infobar_removed_2.Wait(); | 90 infobar_removed_2.Wait(); |
91 EXPECT_EQ(0u, | 91 EXPECT_EQ(0u, |
92 InfoBarService::FromWebContents( | 92 InfoBarService::FromWebContents( |
93 browser()->tab_strip_model()->GetActiveWebContents())-> | 93 browser()->tab_strip_model()->GetActiveWebContents())-> |
94 infobar_count()); | 94 infobar_count()); |
95 } | 95 } |
OLD | NEW |