Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1289)

Unified Diff: chrome/browser/extensions/extension_gallery_install_apitest.cc

Issue 7131001: Partially deprecate the old webstorePrivate.beginInstall method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_gallery_install_apitest.cc
diff --git a/chrome/browser/extensions/extension_gallery_install_apitest.cc b/chrome/browser/extensions/extension_gallery_install_apitest.cc
index 309f4f50f16eef8df3d2f07d197d203574037a6f..2c91d787f5ab068e930fa9e43884b72bc9381a5f 100644
--- a/chrome/browser/extensions/extension_gallery_install_apitest.cc
+++ b/chrome/browser/extensions/extension_gallery_install_apitest.cc
@@ -11,6 +11,10 @@
#include "chrome/browser/extensions/extension_webstore_private_api.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/ui_test_utils.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
+#include "content/common/notification_service.h"
+#include "content/common/notification_type.h"
#include "net/base/mock_host_resolver.h"
class ExtensionGalleryInstallApiTest : public ExtensionApiTest {
@@ -22,6 +26,10 @@ class ExtensionGalleryInstallApiTest : public ExtensionApiTest {
}
bool RunInstallTest(const std::string& page) {
+ NotificationRegistrar registrar;
+ registrar.Add(this,
+ NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
+ NotificationService::AllSources());
std::string base_url = base::StringPrintf(
"http://www.example.com:%u/files/extensions/",
test_server()->host_port_pair().port());
@@ -37,6 +45,24 @@ class ExtensionGalleryInstallApiTest : public ExtensionApiTest {
return RunPageTest(page_url.c_str());
}
+
+ void InstallUIProceed(ExtensionInstallUI::Delegate* delegate) {
+ delegate->InstallUIProceed();
+ }
+
+ // We implement the NotificationObserver interface to drive the install
+ // dialog.
+ virtual void Observe(NotificationType type,
Matt Perry 2011/06/07 18:03:30 Don't you need to call the parent class' Observe?
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE {
+ ExtensionInstallUI* prompt = Source<ExtensionInstallUI>(source).ptr();
+ CHECK(prompt->delegate_);
+ MessageLoop::current()->PostTask(
+ FROM_HERE, NewRunnableMethod(
+ this,
+ &ExtensionGalleryInstallApiTest::InstallUIProceed,
+ prompt->delegate_));
+ }
};
namespace {
« no previous file with comments | « chrome/browser/extensions/crx_installer_browsertest.cc ('k') | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698