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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 11 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
12 #include "chrome/browser/infobars/infobar.h" | |
13 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
16 #include "chrome/browser/themes/theme_service_factory.h" | 15 #include "chrome/browser/themes/theme_service_factory.h" |
17 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_commands.h" | 17 #include "chrome/browser/ui/browser_commands.h" |
19 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 19 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
21 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 20 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
(...skipping 13 matching lines...) Expand all Loading... |
36 // Checks that a theme info bar is currently visible and issues an undo to | 35 // Checks that a theme info bar is currently visible and issues an undo to |
37 // revert to the previous theme. | 36 // revert to the previous theme. |
38 void VerifyThemeInfoBarAndUndoInstall() { | 37 void VerifyThemeInfoBarAndUndoInstall() { |
39 WebContents* web_contents = | 38 WebContents* web_contents = |
40 browser()->tab_strip_model()->GetActiveWebContents(); | 39 browser()->tab_strip_model()->GetActiveWebContents(); |
41 ASSERT_TRUE(web_contents); | 40 ASSERT_TRUE(web_contents); |
42 InfoBarService* infobar_service = | 41 InfoBarService* infobar_service = |
43 InfoBarService::FromWebContents(web_contents); | 42 InfoBarService::FromWebContents(web_contents); |
44 ASSERT_EQ(1U, infobar_service->infobar_count()); | 43 ASSERT_EQ(1U, infobar_service->infobar_count()); |
45 ConfirmInfoBarDelegate* delegate = | 44 ConfirmInfoBarDelegate* delegate = |
46 infobar_service->infobar_at(0)->delegate()->AsConfirmInfoBarDelegate(); | 45 infobar_service->infobar_at(0)->AsConfirmInfoBarDelegate(); |
47 ASSERT_TRUE(delegate); | 46 ASSERT_TRUE(delegate); |
48 delegate->Cancel(); | 47 delegate->Cancel(); |
49 ASSERT_EQ(0U, infobar_service->infobar_count()); | 48 ASSERT_EQ(0U, infobar_service->infobar_count()); |
50 } | 49 } |
51 | 50 |
52 // Install the given theme from the data dir and verify expected name. | 51 // Install the given theme from the data dir and verify expected name. |
53 void InstallThemeAndVerify(const char* theme_name, | 52 void InstallThemeAndVerify(const char* theme_name, |
54 const std::string& expected_name) { | 53 const std::string& expected_name) { |
55 // If there is already a theme installed, the current theme should be | 54 // If there is already a theme installed, the current theme should be |
56 // disabled and the new one installed + enabled. | 55 // disabled and the new one installed + enabled. |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 std::string(), | 240 std::string(), |
242 extension_misc::kWebStoreAppId); | 241 extension_misc::kWebStoreAppId); |
243 EXPECT_EQ(app_id, last_reordered_extension_id_); | 242 EXPECT_EQ(app_id, last_reordered_extension_id_); |
244 | 243 |
245 // Now install the app. | 244 // Now install the app. |
246 const extensions::Extension* test_app = LoadExtension(app_dir); | 245 const extensions::Extension* test_app = LoadExtension(app_dir); |
247 ASSERT_TRUE(test_app); | 246 ASSERT_TRUE(test_app); |
248 EXPECT_TRUE(service->GetInstalledExtension(app_id)); | 247 EXPECT_TRUE(service->GetInstalledExtension(app_id)); |
249 EXPECT_EQ(app_id, test_app->id()); | 248 EXPECT_EQ(app_id, test_app->id()); |
250 } | 249 } |
OLD | NEW |