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

Side by Side Diff: chrome/browser/extensions/extension_install_ui_browsertest.cc

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 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/string_util.h" 5 #include "base/string_util.h"
6 #include "chrome/browser/extensions/extension_browsertest.h" 6 #include "chrome/browser/extensions/extension_browsertest.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" 8 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
9 #include "chrome/browser/infobars/infobar_tab_helper.h" 9 #include "chrome/browser/infobars/infobar_tab_helper.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 10 matching lines...) Expand all
21 using extensions::Extension; 21 using extensions::Extension;
22 22
23 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { 23 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest {
24 public: 24 public:
25 // Checks that a theme info bar is currently visible and issues an undo to 25 // Checks that a theme info bar is currently visible and issues an undo to
26 // revert to the previous theme. 26 // revert to the previous theme.
27 void VerifyThemeInfoBarAndUndoInstall() { 27 void VerifyThemeInfoBarAndUndoInstall() {
28 TabContents* tab = chrome::GetActiveTabContents(browser()); 28 TabContents* tab = chrome::GetActiveTabContents(browser());
29 ASSERT_TRUE(tab); 29 ASSERT_TRUE(tab);
30 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); 30 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper();
31 ASSERT_EQ(1U, infobar_helper->infobar_count()); 31 ASSERT_EQ(1U, infobar_helper->GetInfoBarCount());
32 ConfirmInfoBarDelegate* delegate = infobar_helper-> 32 ConfirmInfoBarDelegate* delegate = infobar_helper->
33 GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); 33 GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate();
34 ASSERT_TRUE(delegate); 34 ASSERT_TRUE(delegate);
35 delegate->Cancel(); 35 delegate->Cancel();
36 ASSERT_EQ(0U, infobar_helper->infobar_count()); 36 ASSERT_EQ(0U, infobar_helper->GetInfoBarCount());
37 } 37 }
38 38
39 const Extension* GetTheme() const { 39 const Extension* GetTheme() const {
40 return ThemeServiceFactory::GetThemeForProfile(browser()->profile()); 40 return ThemeServiceFactory::GetThemeForProfile(browser()->profile());
41 } 41 }
42 }; 42 };
43 43
44 #if defined(OS_LINUX) 44 #if defined(OS_LINUX)
45 // Fails consistently on bot chromium.chromiumos \ Linux. 45 // Fails consistently on bot chromium.chromiumos \ Linux.
46 // See: http://crbug.com/120647. 46 // See: http://crbug.com/120647.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (NewTabUI::ShouldShowApps()) { 149 if (NewTabUI::ShouldShowApps()) {
150 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); 150 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count());
151 WebContents* web_contents = chrome::GetActiveWebContents(browser()); 151 WebContents* web_contents = chrome::GetActiveWebContents(browser());
152 ASSERT_TRUE(web_contents); 152 ASSERT_TRUE(web_contents);
153 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), 153 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(),
154 "chrome://newtab/", false)); 154 "chrome://newtab/", false));
155 } else { 155 } else {
156 // TODO(xiyuan): Figure out how to test extension installed bubble? 156 // TODO(xiyuan): Figure out how to test extension installed bubble?
157 } 157 }
158 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_infobar_delegate.cc ('k') | chrome/browser/extensions/extension_install_ui_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698