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" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |