| 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 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "chrome/browser/browser.h" | 13 #include "chrome/browser/browser.h" |
| 14 #include "chrome/browser/browser_window.h" | 14 #include "chrome/browser/browser_window.h" |
| 15 #include "chrome/browser/location_bar.h" | 15 #include "chrome/browser/location_bar.h" |
| 16 #include "chrome/browser/extensions/crx_installer.h" | 16 #include "chrome/browser/extensions/crx_installer.h" |
| 17 #include "chrome/browser/extensions/extension_error_reporter.h" | 17 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 18 #include "chrome/browser/extensions/extension_host.h" | 18 #include "chrome/browser/extensions/extension_host.h" |
| 19 #include "chrome/browser/extensions/extension_install_ui.h" | 19 #include "chrome/browser/extensions/extension_install_ui.h" |
| 20 #include "chrome/browser/extensions/extensions_service.h" | 20 #include "chrome/browser/extensions/extensions_service.h" |
| 21 #include "chrome/browser/profile.h" | 21 #include "chrome/browser/profile.h" |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 scoped_refptr<CrxInstaller> installer( | 140 scoped_refptr<CrxInstaller> installer( |
| 141 new CrxInstaller(service->install_directory(), service, install_ui)); | 141 new CrxInstaller(service->install_directory(), service, install_ui)); |
| 142 installer->set_expected_id(id); | 142 installer->set_expected_id(id); |
| 143 installer->InstallCrx(path); | 143 installer->InstallCrx(path); |
| 144 | 144 |
| 145 ui_test_utils::RunMessageLoop(); | 145 ui_test_utils::RunMessageLoop(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 size_t num_after = service->extensions()->size(); | 148 size_t num_after = service->extensions()->size(); |
| 149 if (num_after != (num_before + expected_change)) { | 149 if (num_after != (num_before + expected_change)) { |
| 150 std::cout << "Num extensions before: " << IntToString(num_before) << " " | 150 std::cout << "Num extensions before: " |
| 151 << "num after: " << IntToString(num_after) << " " | 151 << base::IntToString(num_before) << " " |
| 152 << "num after: " << base::IntToString(num_after) << " " |
| 152 << "Installed extensions follow:\n"; | 153 << "Installed extensions follow:\n"; |
| 153 | 154 |
| 154 for (size_t i = 0; i < service->extensions()->size(); ++i) | 155 for (size_t i = 0; i < service->extensions()->size(); ++i) |
| 155 std::cout << " " << service->extensions()->at(i)->id() << "\n"; | 156 std::cout << " " << service->extensions()->at(i)->id() << "\n"; |
| 156 | 157 |
| 157 std::cout << "Errors follow:\n"; | 158 std::cout << "Errors follow:\n"; |
| 158 const std::vector<std::string>* errors = | 159 const std::vector<std::string>* errors = |
| 159 ExtensionErrorReporter::GetInstance()->GetErrors(); | 160 ExtensionErrorReporter::GetInstance()->GetErrors(); |
| 160 for (std::vector<std::string>::const_iterator iter = errors->begin(); | 161 for (std::vector<std::string>::const_iterator iter = errors->begin(); |
| 161 iter != errors->end(); ++iter) { | 162 iter != errors->end(); ++iter) { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 MessageLoopForUI::current()->Quit(); | 349 MessageLoopForUI::current()->Quit(); |
| 349 } | 350 } |
| 350 break; | 351 break; |
| 351 } | 352 } |
| 352 | 353 |
| 353 default: | 354 default: |
| 354 NOTREACHED(); | 355 NOTREACHED(); |
| 355 break; | 356 break; |
| 356 } | 357 } |
| 357 } | 358 } |
| OLD | NEW |