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/api/infobars/infobar_service.h" | 5 #include "chrome/browser/api/infobars/infobar_service.h" |
6 #include "chrome/browser/extensions/crx_installer.h" | 6 #include "chrome/browser/extensions/crx_installer.h" |
7 #include "chrome/browser/extensions/extension_install_prompt.h" | 7 #include "chrome/browser/extensions/extension_install_prompt.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
11 #include "chrome/browser/themes/theme_service_factory.h" | 11 #include "chrome/browser/themes/theme_service_factory.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
18 #include "chrome/test/ui/ui_test.h" | 18 #include "chrome/test/ui/ui_test.h" |
19 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
20 #include "net/test/test_server.h" | 20 #include "net/test/test_server.h" |
21 | 21 |
22 class InfoBarsTest : public InProcessBrowserTest { | 22 class InfoBarsTest : public InProcessBrowserTest { |
23 public: | 23 public: |
24 InfoBarsTest() {} | 24 InfoBarsTest() {} |
25 | 25 |
26 void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 26 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
27 command_line->AppendSwitchASCII( | 27 command_line->AppendSwitchASCII( |
28 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); | 28 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); |
29 } | 29 } |
30 | 30 |
31 void InstallExtension(const char* filename) { | 31 void InstallExtension(const char* filename) { |
32 FilePath path = ui_test_utils::GetTestFilePath( | 32 FilePath path = ui_test_utils::GetTestFilePath( |
33 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); | 33 FilePath().AppendASCII("extensions"), FilePath().AppendASCII(filename)); |
34 Profile* profile = browser()->profile(); | 34 Profile* profile = browser()->profile(); |
35 ExtensionService* service = profile->GetExtensionService(); | 35 ExtensionService* service = profile->GetExtensionService(); |
36 | 36 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 content::WindowedNotificationObserver infobar_removed_2( | 80 content::WindowedNotificationObserver infobar_removed_2( |
81 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 81 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
82 content::NotificationService::AllSources()); | 82 content::NotificationService::AllSources()); |
83 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); | 83 ThemeServiceFactory::GetForProfile(browser()->profile())->UseDefaultTheme(); |
84 infobar_removed_2.Wait(); | 84 infobar_removed_2.Wait(); |
85 EXPECT_EQ(0u, | 85 EXPECT_EQ(0u, |
86 InfoBarService::FromWebContents(browser()->tab_strip_model()-> | 86 InfoBarService::FromWebContents(browser()->tab_strip_model()-> |
87 GetActiveWebContents())->GetInfoBarCount()); | 87 GetActiveWebContents())->GetInfoBarCount()); |
88 } | 88 } |
OLD | NEW |