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 "chrome/browser/download/download_crx_util.h" | 5 #include "chrome/browser/download/download_crx_util.h" |
6 #include "chrome/browser/download/download_service.h" | 6 #include "chrome/browser/download/download_service.h" |
7 #include "chrome/browser/download/download_service_factory.h" | 7 #include "chrome/browser/download/download_service_factory.h" |
8 #include "chrome/browser/download/download_test_observer.h" | 8 #include "chrome/browser/download/download_test_observer.h" |
9 #include "chrome/browser/extensions/crx_installer.h" | 9 #include "chrome/browser/extensions/crx_installer.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 class MockInstallUI : public ExtensionInstallUI { | 26 class MockInstallUI : public ExtensionInstallUI { |
27 public: | 27 public: |
28 explicit MockInstallUI(Profile* profile) : | 28 explicit MockInstallUI(Profile* profile) : |
29 ExtensionInstallUI(profile), confirmation_requested_(false) {} | 29 ExtensionInstallUI(profile), confirmation_requested_(false) {} |
30 | 30 |
31 // Did the Delegate request confirmation? | 31 // Did the Delegate request confirmation? |
32 bool confirmation_requested() { return confirmation_requested_; } | 32 bool confirmation_requested() { return confirmation_requested_; } |
33 | 33 |
34 // Overriding some of the ExtensionInstallUI API. | 34 // Overriding some of the ExtensionInstallUI API. |
35 void ConfirmInstall(Delegate* delegate, const Extension* extension) { | 35 void ConfirmInstall(Delegate* delegate, |
| 36 const extensions::Extension* extension) { |
36 confirmation_requested_ = true; | 37 confirmation_requested_ = true; |
37 delegate->InstallUIProceed(); | 38 delegate->InstallUIProceed(); |
38 } | 39 } |
39 void OnInstallSuccess(const Extension* extension, SkBitmap* icon) { | 40 void OnInstallSuccess(const extensions::Extension* extension, |
| 41 SkBitmap* icon) { |
40 MessageLoopForUI::current()->Quit(); | 42 MessageLoopForUI::current()->Quit(); |
41 } | 43 } |
42 void OnInstallFailure(const string16& error) { | 44 void OnInstallFailure(const string16& error) { |
43 ADD_FAILURE() << "install failed"; | 45 ADD_FAILURE() << "install failed"; |
44 MessageLoopForUI::current()->Quit(); | 46 MessageLoopForUI::current()->Quit(); |
45 } | 47 } |
46 | 48 |
47 private: | 49 private: |
48 bool confirmation_requested_; | 50 bool confirmation_requested_; |
49 }; | 51 }; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); | 155 DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); |
154 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; | 156 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; |
155 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, | 157 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, |
156 ui_test_utils::BROWSER_TEST_NONE); | 158 ui_test_utils::BROWSER_TEST_NONE); |
157 | 159 |
158 EXPECT_TRUE(WaitForExtensionInstall()); | 160 EXPECT_TRUE(WaitForExtensionInstall()); |
159 LOG(ERROR) << "PackAndInstallExtension: Extension install"; | 161 LOG(ERROR) << "PackAndInstallExtension: Extension install"; |
160 EXPECT_TRUE(mock_ui->confirmation_requested()); | 162 EXPECT_TRUE(mock_ui->confirmation_requested()); |
161 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; | 163 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; |
162 } | 164 } |
OLD | NEW |