OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
7 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 7 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 theme = browser()->profile()->GetTheme(); | 53 theme = browser()->profile()->GetTheme(); |
54 ASSERT_TRUE(theme); | 54 ASSERT_TRUE(theme); |
55 ASSERT_EQ(theme_crx, theme->id()); | 55 ASSERT_EQ(theme_crx, theme->id()); |
56 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); | 56 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 0)); |
57 theme = browser()->profile()->GetTheme(); | 57 theme = browser()->profile()->GetTheme(); |
58 ASSERT_TRUE(theme); | 58 ASSERT_TRUE(theme); |
59 ASSERT_EQ(theme_crx, theme->id()); | 59 ASSERT_EQ(theme_crx, theme->id()); |
60 VerifyThemeInfoBarAndUndoInstall(); | 60 VerifyThemeInfoBarAndUndoInstall(); |
61 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); | 61 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); |
62 } | 62 } |
63 | |
64 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, | |
65 AppInstallConfirmation) { | |
66 int num_tabs = browser()->tab_count(); | |
67 | |
68 FilePath app_path = test_data_dir_.AppendASCII("app.crx"); | |
69 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_path, 1, | |
70 browser()->profile())); | |
71 EXPECT_EQ(num_tabs + 1, browser()->tab_count()); | |
Aaron Boodman
2010/12/14 23:21:44
Is it also possible to test that the new tab is th
Tessa MacDuff
2010/12/15 00:38:55
Done.
| |
72 } | |
73 | |
74 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, | |
75 AppInstallConfirmation_Incognito) { | |
76 Profile* incognito_profile = browser()->profile()->GetOffTheRecordProfile(); | |
77 Browser* incognito_browser = Browser::GetOrCreateTabbedBrowser( | |
78 incognito_profile); | |
79 | |
80 int num_incognito_tabs = incognito_browser->tab_count(); | |
81 int num_normal_tabs = browser()->tab_count(); | |
82 | |
83 FilePath app_path = test_data_dir_.AppendASCII("app.crx"); | |
84 ASSERT_TRUE(InstallExtensionWithUIAutoConfirm(app_path, 1, | |
85 incognito_profile)); | |
86 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count()); | |
87 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); | |
88 } | |
OLD | NEW |