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

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

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), 115 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(),
116 "chrome://newtab/", false)); 116 "chrome://newtab/", false));
117 } else { 117 } else {
118 // TODO(xiyuan): Figure out how to test extension installed bubble? 118 // TODO(xiyuan): Figure out how to test extension installed bubble?
119 } 119 }
120 } 120 }
121 121
122 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, 122 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
123 AppInstallConfirmation_Incognito) { 123 AppInstallConfirmation_Incognito) {
124 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); 124 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
125 Browser* incognito_browser = Browser::Create(incognito_profile); 125 Browser* incognito_browser =
126 new Browser(Browser::CreateParams(incognito_profile));
126 127
127 int num_incognito_tabs = incognito_browser->tab_count(); 128 int num_incognito_tabs = incognito_browser->tab_count();
128 int num_normal_tabs = browser()->tab_count(); 129 int num_normal_tabs = browser()->tab_count();
129 130
130 FilePath app_dir = test_data_dir_.AppendASCII("app"); 131 FilePath app_dir = test_data_dir_.AppendASCII("app");
131 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1, 132 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1,
132 incognito_browser)); 133 incognito_browser));
133 134
134 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count()); 135 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count());
135 if (NewTabUI::ShouldShowApps()) { 136 if (NewTabUI::ShouldShowApps()) {
136 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); 137 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count());
137 WebContents* web_contents = chrome::GetActiveWebContents(browser()); 138 WebContents* web_contents = chrome::GetActiveWebContents(browser());
138 ASSERT_TRUE(web_contents); 139 ASSERT_TRUE(web_contents);
139 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(), 140 EXPECT_TRUE(StartsWithASCII(web_contents->GetURL().spec(),
140 "chrome://newtab/", false)); 141 "chrome://newtab/", false));
141 } else { 142 } else {
142 // TODO(xiyuan): Figure out how to test extension installed bubble? 143 // TODO(xiyuan): Figure out how to test extension installed bubble?
143 } 144 }
144 } 145 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_test.cc ('k') | chrome/browser/extensions/extension_tab_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698