OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/webui/extensions/extension_settings_browsertest.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_browsertest.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/extensions/crx_installer.h" | 11 #include "chrome/browser/extensions/crx_installer.h" |
12 #include "chrome/browser/extensions/extension_error_reporter.h" | 12 #include "chrome/browser/extensions/extension_error_reporter.h" |
13 #include "chrome/browser/extensions/extension_install_prompt.h" | 13 #include "chrome/browser/extensions/extension_install_prompt.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/extensions/extension_system.h" | 15 #include "chrome/browser/extensions/extension_system.h" |
16 #include "chrome/browser/extensions/unpacked_installer.h" | 16 #include "chrome/browser/extensions/unpacked_installer.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
22 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
23 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
25 #include "content/public/test/browser_test_utils.h" | 25 #include "content/public/test/browser_test_utils.h" |
26 #include "content/public/test/test_utils.h" | 26 #include "content/public/test/test_utils.h" |
| 27 #include "extensions/common/extension_set.h" |
27 | 28 |
28 using extensions::Extension; | 29 using extensions::Extension; |
29 | 30 |
30 ExtensionSettingsUIBrowserTest::ExtensionSettingsUIBrowserTest() | 31 ExtensionSettingsUIBrowserTest::ExtensionSettingsUIBrowserTest() |
31 : profile_(NULL) {} | 32 : profile_(NULL) {} |
32 | 33 |
33 ExtensionSettingsUIBrowserTest::~ExtensionSettingsUIBrowserTest() {} | 34 ExtensionSettingsUIBrowserTest::~ExtensionSettingsUIBrowserTest() {} |
34 | 35 |
35 Profile* ExtensionSettingsUIBrowserTest::GetProfile() { | 36 Profile* ExtensionSettingsUIBrowserTest::GetProfile() { |
36 if (!profile_) { | 37 if (!profile_) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 104 |
104 observer_->Wait(); | 105 observer_->Wait(); |
105 } | 106 } |
106 | 107 |
107 size_t num_after = service->extensions()->size(); | 108 size_t num_after = service->extensions()->size(); |
108 if (num_before + 1 != num_after) { | 109 if (num_before + 1 != num_after) { |
109 VLOG(1) << "Num extensions before: " << base::IntToString(num_before) | 110 VLOG(1) << "Num extensions before: " << base::IntToString(num_before) |
110 << " num after: " << base::IntToString(num_after) | 111 << " num after: " << base::IntToString(num_after) |
111 << " Installed extensions follow:"; | 112 << " Installed extensions follow:"; |
112 | 113 |
113 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 114 for (extensions::ExtensionSet::const_iterator it = |
| 115 service->extensions()->begin(); |
114 it != service->extensions()->end(); ++it) | 116 it != service->extensions()->end(); ++it) |
115 VLOG(1) << " " << (*it)->id(); | 117 VLOG(1) << " " << (*it)->id(); |
116 | 118 |
117 VLOG(1) << "Errors follow:"; | 119 VLOG(1) << "Errors follow:"; |
118 const std::vector<base::string16>* errors = | 120 const std::vector<base::string16>* errors = |
119 ExtensionErrorReporter::GetInstance()->GetErrors(); | 121 ExtensionErrorReporter::GetInstance()->GetErrors(); |
120 for (std::vector<base::string16>::const_iterator iter = errors->begin(); | 122 for (std::vector<base::string16>::const_iterator iter = errors->begin(); |
121 iter != errors->end(); ++iter) | 123 iter != errors->end(); ++iter) |
122 VLOG(1) << *iter; | 124 VLOG(1) << *iter; |
123 | 125 |
124 return NULL; | 126 return NULL; |
125 } | 127 } |
126 | 128 |
127 if (!observer_->WaitForExtensionViewsToLoad()) | 129 if (!observer_->WaitForExtensionViewsToLoad()) |
128 return NULL; | 130 return NULL; |
129 return service->GetExtensionById(last_loaded_extension_id(), false); | 131 return service->GetExtensionById(last_loaded_extension_id(), false); |
130 } | 132 } |
OLD | NEW |