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

Unified Diff: chrome/browser/extensions/extension_install_ui_browsertest.cc

Issue 5543001: Tests for incognito app install, plus some cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use FILE_PATH_LITERAL Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_install_ui_browsertest.cc
diff --git a/chrome/browser/extensions/extension_install_ui_browsertest.cc b/chrome/browser/extensions/extension_install_ui_browsertest.cc
index 6866325763caca7db0c1943fcc0b14482fb51a9d..ef95025d21c37a256842fbf749618baf239e4b00 100644
--- a/chrome/browser/extensions/extension_install_ui_browsertest.cc
+++ b/chrome/browser/extensions/extension_install_ui_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/string_util.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
@@ -60,3 +61,41 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
VerifyThemeInfoBarAndUndoInstall();
ASSERT_EQ(NULL, browser()->profile()->GetTheme());
}
+
+IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
+ AppInstallConfirmation) {
+ int num_tabs = browser()->tab_count();
+
+ FilePath app_dir = test_data_dir_.AppendASCII("app");
+ ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1,
+ browser()->profile()));
+
+ EXPECT_EQ(num_tabs + 1, browser()->tab_count());
+ TabContents* tab_contents = browser()->GetSelectedTabContents();
+ ASSERT_TRUE(tab_contents);
+ EXPECT_TRUE(StartsWithASCII(tab_contents->GetURL().spec(),
+ "chrome://newtab/#app-id=", // id changes
+ false));
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest,
+ AppInstallConfirmation_Incognito) {
+ Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile();
+ Browser* incognito_browser = Browser::GetOrCreateTabbedBrowser(
+ incognito_profile);
+
+ int num_incognito_tabs = incognito_browser->tab_count();
+ int num_normal_tabs = browser()->tab_count();
+
+ FilePath app_dir = test_data_dir_.AppendASCII("app");
+ ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_dir, 1,
+ incognito_profile));
+
+ EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count());
+ EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count());
+ TabContents* tab_contents = browser()->GetSelectedTabContents();
+ ASSERT_TRUE(tab_contents);
+ EXPECT_TRUE(StartsWithASCII(tab_contents->GetURL().spec(),
+ "chrome://newtab/#app-id=", // id changes
+ false));
+}

Powered by Google App Engine
This is Rietveld 408576698