| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 ASSERT_TRUE(tab_contents); | 27 ASSERT_TRUE(tab_contents); |
| 28 ASSERT_EQ(1, tab_contents->infobar_delegate_count()); | 28 ASSERT_EQ(1, tab_contents->infobar_delegate_count()); |
| 29 ConfirmInfoBarDelegate* delegate = | 29 ConfirmInfoBarDelegate* delegate = |
| 30 tab_contents->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); | 30 tab_contents->GetInfoBarDelegateAt(0)->AsConfirmInfoBarDelegate(); |
| 31 ASSERT_TRUE(delegate); | 31 ASSERT_TRUE(delegate); |
| 32 delegate->Cancel(); | 32 delegate->Cancel(); |
| 33 ASSERT_EQ(0, tab_contents->infobar_delegate_count()); | 33 ASSERT_EQ(0, tab_contents->infobar_delegate_count()); |
| 34 } | 34 } |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 // Crashy, http://crbug.com/44548. | |
| 38 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, | 37 IN_PROC_BROWSER_TEST_F(ExtensionInstallUIBrowserTest, |
| 39 DISABLED_TestThemeInstallUndoResetsToDefault) { | 38 TestThemeInstallUndoResetsToDefault) { |
| 40 // Install theme once and undo to verify we go back to default theme. | 39 // Install theme once and undo to verify we go back to default theme. |
| 41 FilePath theme_path = test_data_dir_.AppendASCII("theme.crx"); | 40 FilePath theme_path = test_data_dir_.AppendASCII("theme.crx"); |
| 42 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); | 41 ASSERT_TRUE(InstallExtensionWithUI(theme_path, 1)); |
| 43 const Extension* theme = browser()->profile()->GetTheme(); | 42 const Extension* theme = browser()->profile()->GetTheme(); |
| 44 ASSERT_TRUE(theme); | 43 ASSERT_TRUE(theme); |
| 45 ASSERT_EQ(theme_crx, theme->id()); | 44 ASSERT_EQ(theme_crx, theme->id()); |
| 46 VerifyThemeInfoBarAndUndoInstall(); | 45 VerifyThemeInfoBarAndUndoInstall(); |
| 47 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); | 46 ASSERT_EQ(NULL, browser()->profile()->GetTheme()); |
| 48 | 47 |
| 49 // Set the same theme twice and undo to verify we go back to default theme. | 48 // Set the same theme twice and undo to verify we go back to default theme. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 incognito_profile)); | 91 incognito_profile)); |
| 93 | 92 |
| 94 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count()); | 93 EXPECT_EQ(num_incognito_tabs, incognito_browser->tab_count()); |
| 95 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); | 94 EXPECT_EQ(num_normal_tabs + 1, browser()->tab_count()); |
| 96 TabContents* tab_contents = browser()->GetSelectedTabContents(); | 95 TabContents* tab_contents = browser()->GetSelectedTabContents(); |
| 97 ASSERT_TRUE(tab_contents); | 96 ASSERT_TRUE(tab_contents); |
| 98 EXPECT_TRUE(StartsWithASCII(tab_contents->GetURL().spec(), | 97 EXPECT_TRUE(StartsWithASCII(tab_contents->GetURL().spec(), |
| 99 "chrome://newtab/#app-id=", // id changes | 98 "chrome://newtab/#app-id=", // id changes |
| 100 false)); | 99 false)); |
| 101 } | 100 } |
| OLD | NEW |