Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: chrome/browser/infobars/infobars_browsertest.cc

Issue 228293004: InfoBarService inherits from InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whitespace Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_manager.h"
11 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
12 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/themes/theme_service.h" 12 #include "chrome/browser/themes/theme_service.h"
14 #include "chrome/browser/themes/theme_service_factory.h" 13 #include "chrome/browser/themes/theme_service_factory.h"
15 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
18 #include "chrome/test/base/in_process_browser_test.h" 17 #include "chrome/test/base/in_process_browser_test.h"
19 #include "chrome/test/base/test_switches.h" 18 #include "chrome/test/base/test_switches.h"
20 #include "chrome/test/base/ui_test_utils.h" 19 #include "chrome/test/base/ui_test_utils.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); 74 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
76 content::WindowedNotificationObserver infobar_added_2( 75 content::WindowedNotificationObserver infobar_added_2(
77 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, 76 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
78 content::NotificationService::AllSources()); 77 content::NotificationService::AllSources());
79 content::WindowedNotificationObserver infobar_removed_1( 78 content::WindowedNotificationObserver infobar_removed_1(
80 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, 79 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
81 content::NotificationService::AllSources()); 80 content::NotificationService::AllSources());
82 InstallExtension("theme2.crx"); 81 InstallExtension("theme2.crx");
83 infobar_added_2.Wait(); 82 infobar_added_2.Wait();
84 infobar_removed_1.Wait(); 83 infobar_removed_1.Wait();
85 EXPECT_EQ(0u, 84 EXPECT_EQ(
86 InfoBarService::FromWebContents(browser()->tab_strip_model()-> 85 0u,
87 GetWebContentsAt(0))->infobar_manager()->infobar_count()); 86 InfoBarService::FromWebContents(
87 browser()->tab_strip_model()->GetWebContentsAt(0))->infobar_count());
88 88
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(browser()->tab_strip_model()-> 95 InfoBarService::FromWebContents(
96 GetActiveWebContents())->infobar_manager()->infobar_count()); 96 browser()->tab_strip_model()->GetActiveWebContents())
97 ->infobar_count());
Peter Kasting 2014/04/10 00:08:59 Nit: Place arrow on end of previous line
97 } 98 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698