| 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 "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" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 MockAbortExtensionInstallUI() : ExtensionInstallUI(NULL) {} | 209 MockAbortExtensionInstallUI() : ExtensionInstallUI(NULL) {} |
| 210 | 210 |
| 211 // Simulate a user abort on an extension installation. | 211 // Simulate a user abort on an extension installation. |
| 212 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { | 212 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { |
| 213 delegate->InstallUIAbort(true); | 213 delegate->InstallUIAbort(true); |
| 214 MessageLoopForUI::current()->Quit(); | 214 MessageLoopForUI::current()->Quit(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {} | 217 virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) {} |
| 218 | 218 |
| 219 virtual void OnInstallFailure(const std::string& error) {} | 219 virtual void OnInstallFailure(const string16& error) {} |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 class MockAutoConfirmExtensionInstallUI : public ExtensionInstallUI { | 222 class MockAutoConfirmExtensionInstallUI : public ExtensionInstallUI { |
| 223 public: | 223 public: |
| 224 explicit MockAutoConfirmExtensionInstallUI(Profile* profile) : | 224 explicit MockAutoConfirmExtensionInstallUI(Profile* profile) : |
| 225 ExtensionInstallUI(profile) {} | 225 ExtensionInstallUI(profile) {} |
| 226 | 226 |
| 227 // Proceed without confirmation prompt. | 227 // Proceed without confirmation prompt. |
| 228 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { | 228 virtual void ConfirmInstall(Delegate* delegate, const Extension* extension) { |
| 229 delegate->InstallUIProceed(); | 229 delegate->InstallUIProceed(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (num_before + expected_change != num_after) { | 295 if (num_before + expected_change != num_after) { |
| 296 VLOG(1) << "Num extensions before: " << base::IntToString(num_before) | 296 VLOG(1) << "Num extensions before: " << base::IntToString(num_before) |
| 297 << " num after: " << base::IntToString(num_after) | 297 << " num after: " << base::IntToString(num_after) |
| 298 << " Installed extensions follow:"; | 298 << " Installed extensions follow:"; |
| 299 | 299 |
| 300 for (ExtensionSet::const_iterator it = service->extensions()->begin(); | 300 for (ExtensionSet::const_iterator it = service->extensions()->begin(); |
| 301 it != service->extensions()->end(); ++it) | 301 it != service->extensions()->end(); ++it) |
| 302 VLOG(1) << " " << (*it)->id(); | 302 VLOG(1) << " " << (*it)->id(); |
| 303 | 303 |
| 304 VLOG(1) << "Errors follow:"; | 304 VLOG(1) << "Errors follow:"; |
| 305 const std::vector<std::string>* errors = | 305 const std::vector<string16>* errors = |
| 306 ExtensionErrorReporter::GetInstance()->GetErrors(); | 306 ExtensionErrorReporter::GetInstance()->GetErrors(); |
| 307 for (std::vector<std::string>::const_iterator iter = errors->begin(); | 307 for (std::vector<string16>::const_iterator iter = errors->begin(); |
| 308 iter != errors->end(); ++iter) | 308 iter != errors->end(); ++iter) |
| 309 VLOG(1) << *iter; | 309 VLOG(1) << *iter; |
| 310 | 310 |
| 311 return NULL; | 311 return NULL; |
| 312 } | 312 } |
| 313 | 313 |
| 314 if (!WaitForExtensionHostsToLoad()) | 314 if (!WaitForExtensionHostsToLoad()) |
| 315 return NULL; | 315 return NULL; |
| 316 return service->GetExtensionById(last_loaded_extension_id_, false); | 316 return service->GetExtensionById(last_loaded_extension_id_, false); |
| 317 } | 317 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 MessageLoopForUI::current()->Quit(); | 499 MessageLoopForUI::current()->Quit(); |
| 500 } | 500 } |
| 501 break; | 501 break; |
| 502 } | 502 } |
| 503 | 503 |
| 504 default: | 504 default: |
| 505 NOTREACHED(); | 505 NOTREACHED(); |
| 506 break; | 506 break; |
| 507 } | 507 } |
| 508 } | 508 } |
| OLD | NEW |