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/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" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_finder.h" | 12 #include "chrome/browser/ui/browser_finder.h" |
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
14 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 14 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
15 #include "chrome/browser/themes/theme_service_factory.h" | 15 #include "chrome/browser/themes/theme_service_factory.h" |
16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 | 18 |
19 using content::WebContents; | 19 using content::WebContents; |
| 20 using extensions::Extension; |
20 | 21 |
21 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { | 22 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { |
22 public: | 23 public: |
23 // Checks that a theme info bar is currently visible and issues an undo to | 24 // Checks that a theme info bar is currently visible and issues an undo to |
24 // revert to the previous theme. | 25 // revert to the previous theme. |
25 void VerifyThemeInfoBarAndUndoInstall() { | 26 void VerifyThemeInfoBarAndUndoInstall() { |
26 TabContentsWrapper* tab = browser()->GetSelectedTabContentsWrapper(); | 27 TabContentsWrapper* tab = browser()->GetSelectedTabContentsWrapper(); |
27 ASSERT_TRUE(tab); | 28 ASSERT_TRUE(tab); |
28 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | 29 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); |
29 ASSERT_EQ(1U, infobar_helper->infobar_count()); | 30 ASSERT_EQ(1U, infobar_helper->infobar_count()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (NewTabUI::ShouldShowApps()) { | 132 if (NewTabUI::ShouldShowApps()) { |
132 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); | 133 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); |
133 WebContents* web_contents = browser()->GetSelectedWebContents(); | 134 WebContents* web_contents = browser()->GetSelectedWebContents(); |
134 ASSERT_TRUE(web_contents); | 135 ASSERT_TRUE(web_contents); |
135 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), | 136 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), |
136 "chrome://newtab/", false)); | 137 "chrome://newtab/", false)); |
137 } else { | 138 } else { |
138 // TODO(xiyuan): Figure out how to test extension installed bubble? | 139 // TODO(xiyuan): Figure out how to test extension installed bubble? |
139 } | 140 } |
140 } | 141 } |
OLD | NEW |