| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 browser(), embedded_test_server()->GetURL("/simple.html")); | 60 browser(), embedded_test_server()->GetURL("/simple.html")); |
| 61 | 61 |
| 62 content::WindowedNotificationObserver infobar_added_1( | 62 content::WindowedNotificationObserver infobar_added_1( |
| 63 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 63 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
| 64 content::NotificationService::AllSources()); | 64 content::NotificationService::AllSources()); |
| 65 InstallExtension("theme.crx"); | 65 InstallExtension("theme.crx"); |
| 66 infobar_added_1.Wait(); | 66 infobar_added_1.Wait(); |
| 67 | 67 |
| 68 ui_test_utils::NavigateToURLWithDisposition( | 68 ui_test_utils::NavigateToURLWithDisposition( |
| 69 browser(), embedded_test_server()->GetURL("/simple.html"), | 69 browser(), embedded_test_server()->GetURL("/simple.html"), |
| 70 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 70 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 71 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 71 content::WindowedNotificationObserver infobar_added_2( | 72 content::WindowedNotificationObserver infobar_added_2( |
| 72 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, | 73 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, |
| 73 content::NotificationService::AllSources()); | 74 content::NotificationService::AllSources()); |
| 74 content::WindowedNotificationObserver infobar_removed_1( | 75 content::WindowedNotificationObserver infobar_removed_1( |
| 75 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 76 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 76 content::NotificationService::AllSources()); | 77 content::NotificationService::AllSources()); |
| 77 InstallExtension("theme2.crx"); | 78 InstallExtension("theme2.crx"); |
| 78 infobar_added_2.Wait(); | 79 infobar_added_2.Wait(); |
| 79 infobar_removed_1.Wait(); | 80 infobar_removed_1.Wait(); |
| 80 EXPECT_EQ( | 81 EXPECT_EQ( |
| 81 0u, | 82 0u, |
| 82 InfoBarService::FromWebContents( | 83 InfoBarService::FromWebContents( |
| 83 browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); | 84 browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count()); |
| 84 | 85 |
| 85 content::WindowedNotificationObserver infobar_removed_2( | 86 content::WindowedNotificationObserver infobar_removed_2( |
| 86 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 87 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 87 content::NotificationService::AllSources()); | 88 content::NotificationService::AllSources()); |
| 88 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 89 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
| 89 infobar_removed_2.Wait(); | 90 infobar_removed_2.Wait(); |
| 90 EXPECT_EQ(0u, | 91 EXPECT_EQ(0u, |
| 91 InfoBarService::FromWebContents( | 92 InfoBarService::FromWebContents( |
| 92 browser()->tab_strip_model()->GetActiveWebContents())-> | 93 browser()->tab_strip_model()->GetActiveWebContents())-> |
| 93 infobar_count()); | 94 infobar_count()); |
| 94 } | 95 } |
| OLD | NEW |