| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "chrome/browser/chrome_notification_types.h" | 6 #include "chrome/browser/chrome_notification_types.h" |
| 7 #include "chrome/browser/extensions/crx_installer.h" | 7 #include "chrome/browser/extensions/crx_installer.h" |
| 8 #include "chrome/browser/extensions/extension_install_prompt.h" | 8 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 void InstallExtension(const char* filename) { | 32 void InstallExtension(const char* filename) { |
| 33 base::FilePath path = ui_test_utils::GetTestFilePath( | 33 base::FilePath path = ui_test_utils::GetTestFilePath( |
| 34 base::FilePath().AppendASCII("extensions"), | 34 base::FilePath().AppendASCII("extensions"), |
| 35 base::FilePath().AppendASCII(filename)); | 35 base::FilePath().AppendASCII(filename)); |
| 36 Profile* profile = browser()->profile(); | 36 Profile* profile = browser()->profile(); |
| 37 ExtensionService* service = profile->GetExtensionService(); | 37 ExtensionService* service = profile->GetExtensionService(); |
| 38 | 38 |
| 39 content::WindowedNotificationObserver observer( | 39 content::WindowedNotificationObserver observer( |
| 40 chrome::NOTIFICATION_EXTENSION_LOADED, | 40 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
| 41 content::NotificationService::AllSources()); | 41 content::NotificationService::AllSources()); |
| 42 | 42 |
| 43 scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt( | 43 scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt( |
| 44 browser()->tab_strip_model()->GetActiveWebContents())); | 44 browser()->tab_strip_model()->GetActiveWebContents())); |
| 45 scoped_refptr<extensions::CrxInstaller> installer( | 45 scoped_refptr<extensions::CrxInstaller> installer( |
| 46 extensions::CrxInstaller::Create(service, client.Pass())); | 46 extensions::CrxInstaller::Create(service, client.Pass())); |
| 47 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 47 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
| 48 installer->InstallCrx(path); | 48 installer->InstallCrx(path); |
| 49 | 49 |
| 50 observer.Wait(); | 50 observer.Wait(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 content::WindowedNotificationObserver infobar_removed_2( | 89 content::WindowedNotificationObserver infobar_removed_2( |
| 90 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 90 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
| 91 content::NotificationService::AllSources()); | 91 content::NotificationService::AllSources()); |
| 92 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 92 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
| 93 infobar_removed_2.Wait(); | 93 infobar_removed_2.Wait(); |
| 94 EXPECT_EQ(0u, | 94 EXPECT_EQ(0u, |
| 95 InfoBarService::FromWebContents( | 95 InfoBarService::FromWebContents( |
| 96 browser()->tab_strip_model()->GetActiveWebContents())-> | 96 browser()->tab_strip_model()->GetActiveWebContents())-> |
| 97 infobar_count()); | 97 infobar_count()); |
| 98 } | 98 } |
| OLD | NEW |