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

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

Issue 10391158: Moves methods for finding browsers to browser_finder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include fixs Created 8 years, 7 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"
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/tab_contents/tab_contents_wrapper.h" 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
13 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 14 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
14 #include "chrome/browser/themes/theme_service_factory.h" 15 #include "chrome/browser/themes/theme_service_factory.h"
15 #include "chrome/test/base/ui_test_utils.h" 16 #include "chrome/test/base/ui_test_utils.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 18
18 using content::WebContents; 19 using content::WebContents;
19 20
20 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest { 21 class ExtensionInstallUIBrowserTest : public ExtensionBrowserTest {
21 public: 22 public:
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), 110 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(),
110 "chrome://newtab/", false)); 111 "chrome://newtab/", false));
111 } else { 112 } else {
112 // TODO(xiyuan): Figure out how to test extension installed bubble? 113 // TODO(xiyuan): Figure out how to test extension installed bubble?
113 } 114 }
114 } 115 }
115 116
116 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, 117 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
117 AppInstallConfirmation_Incognito) { 118 AppInstallConfirmation_Incognito) {
118 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); 119 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
119 Browser* incognito_browser = Browser::GetOrCreateTabbedBrowser( 120 Browser* incognito_browser = browser::FindOrCreateTabbedBrowser(
120 incognito_profile); 121 incognito_profile);
121 122
122 int num_incognito_tabs = incognito_browser->tab_count(); 123 int num_incognito_tabs = incognito_browser->tab_count();
123 int num_normal_tabs = browser()->tab_count(); 124 int num_normal_tabs = browser()->tab_count();
124 125
125 FilePath app_dir = test_data_dir_.AppendASCII("app"); 126 FilePath app_dir = test_data_dir_.AppendASCII("app");
126 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1, 127 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1,
127 incognito_profile)); 128 incognito_profile));
128 129
129 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count()); 130 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count());
130 if (NewTabUI::ShouldShowApps()) { 131 if (NewTabUI::ShouldShowApps()) {
131 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); 132 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count());
132 WebContents* web_contents = browser()->GetSelectedWebContents(); 133 WebContents* web_contents = browser()->GetSelectedWebContents();
133 ASSERT_TRUE(web_contents); 134 ASSERT_TRUE(web_contents);
134 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), 135 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(),
135 "chrome://newtab/", false)); 136 "chrome://newtab/", false));
136 } else { 137 } else {
137 // TODO(xiyuan): Figure out how to test extension installed bubble? 138 // TODO(xiyuan): Figure out how to test extension installed bubble?
138 } 139 }
139 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698