| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void InstallExtension(const char* filename) { | 32 void InstallExtension(const char* filename) { |
| 33 FilePath path = ui_test_utils::GetTestFilePath( | 33 FilePath path = ui_test_utils::GetTestFilePath( |
| 34 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); | 34 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); |
| 35 Profile* profile = browser()->profile(); | 35 Profile* profile = browser()->profile(); |
| 36 ExtensionService* service = profile->GetExtensionService(); | 36 ExtensionService* service = profile->GetExtensionService(); |
| 37 | 37 |
| 38 ui_test_utils::WindowedNotificationObserver observer( | 38 ui_test_utils::WindowedNotificationObserver observer( |
| 39 chrome::NOTIFICATION_EXTENSION_LOADED, | 39 chrome::NOTIFICATION_EXTENSION_LOADED, |
| 40 content::NotificationService::AllSources()); | 40 content::NotificationService::AllSources()); |
| 41 | 41 |
| 42 ExtensionInstallPrompt* client = new ExtensionInstallPrompt(browser()); | 42 ExtensionInstallPrompt* client = |
| 43 chrome::CreateExtensionInstallPromptWithBrowser(browser()); |
| 43 scoped_refptr<CrxInstaller> installer( | 44 scoped_refptr<CrxInstaller> installer( |
| 44 CrxInstaller::Create(service, client)); | 45 CrxInstaller::Create(service, client)); |
| 45 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 46 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 46 installer->InstallCrx(path); | 47 installer->InstallCrx(path); |
| 47 | 48 |
| 48 observer.Wait(); | 49 observer.Wait(); |
| 49 } | 50 } |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) { | 53 IN_PROC_BROWSER_TEST_F(InfoBarsTest, TestInfoBarsCloseOnNewTheme) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 79 | 80 |
| 80 ui_test_utils::WindowedNotificationObserver infobar_removed_2( | 81 ui_test_utils::WindowedNotificationObserver infobar_removed_2( |
| 81 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 82 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 82 content::NotificationService::AllSources()); | 83 content::NotificationService::AllSources()); |
| 83 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 84 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
| 84 infobar_removed_2.Wait(); | 85 infobar_removed_2.Wait(); |
| 85 EXPECT_EQ(0u, | 86 EXPECT_EQ(0u, |
| 86 chrome::GetActiveTabContents(browser())->infobar_tab_helper()-> | 87 chrome::GetActiveTabContents(browser())->infobar_tab_helper()-> |
| 87 infobar_count()); | 88 infobar_count()); |
| 88 } | 89 } |
| OLD | NEW |