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 15 matching lines...) Expand all Loading... |
26 InfoBarsTest() {} | 26 InfoBarsTest() {} |
27 | 27 |
28 void InstallExtension(const char* filename) { | 28 void InstallExtension(const char* filename) { |
29 base::FilePath path = ui_test_utils::GetTestFilePath( | 29 base::FilePath path = ui_test_utils::GetTestFilePath( |
30 base::FilePath().AppendASCII("extensions"), | 30 base::FilePath().AppendASCII("extensions"), |
31 base::FilePath().AppendASCII(filename)); | 31 base::FilePath().AppendASCII(filename)); |
32 ExtensionService* service = extensions::ExtensionSystem::Get( | 32 ExtensionService* service = extensions::ExtensionSystem::Get( |
33 browser()->profile())->extension_service(); | 33 browser()->profile())->extension_service(); |
34 | 34 |
35 content::WindowedNotificationObserver observer( | 35 content::WindowedNotificationObserver observer( |
36 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 36 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
37 content::NotificationService::AllSources()); | 37 content::NotificationService::AllSources()); |
38 | 38 |
39 scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt( | 39 scoped_ptr<ExtensionInstallPrompt> client(new ExtensionInstallPrompt( |
40 browser()->tab_strip_model()->GetActiveWebContents())); | 40 browser()->tab_strip_model()->GetActiveWebContents())); |
41 scoped_refptr<extensions::CrxInstaller> installer( | 41 scoped_refptr<extensions::CrxInstaller> installer( |
42 extensions::CrxInstaller::Create(service, client.Pass())); | 42 extensions::CrxInstaller::Create(service, client.Pass())); |
43 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); | 43 installer->set_install_cause(extension_misc::INSTALL_CAUSE_AUTOMATION); |
44 installer->InstallCrx(path); | 44 installer->InstallCrx(path); |
45 | 45 |
46 observer.Wait(); | 46 observer.Wait(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 content::WindowedNotificationObserver infobar_removed_2( | 88 content::WindowedNotificationObserver infobar_removed_2( |
89 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 89 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
90 content::NotificationService::AllSources()); | 90 content::NotificationService::AllSources()); |
91 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 91 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
92 infobar_removed_2.Wait(); | 92 infobar_removed_2.Wait(); |
93 EXPECT_EQ(0u, | 93 EXPECT_EQ(0u, |
94 InfoBarService::FromWebContents( | 94 InfoBarService::FromWebContents( |
95 browser()->tab_strip_model()->GetActiveWebContents())-> | 95 browser()->tab_strip_model()->GetActiveWebContents())-> |
96 infobar_count()); | 96 infobar_count()); |
97 } | 97 } |
OLD | NEW |