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