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

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc

Issue 916243002: Enable keyboard shortcuts for chrome://extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply Feedback Created 5 years, 10 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/ui/webui/extensions/extension_settings_browsertest.cc
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc
index 111f8d226f4cd279a349b02b6b91470b3942b384..1a2089ef63336b8d8a978ce3497ef860c6618511 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc
@@ -62,6 +62,18 @@ void ExtensionSettingsUIBrowserTest::InstallGoodExtension() {
InstallExtension(extensions_data_dir.AppendASCII("good.crx"));
}
+void ExtensionSettingsUIBrowserTest::InstallErrorsExtension() {
+ base::FilePath test_data_dir;
+ if (!PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)) {
+ ADD_FAILURE();
+ return;
+ }
+ base::FilePath extensions_data_dir = test_data_dir.AppendASCII("extensions");
+ extensions_data_dir = extensions_data_dir.AppendASCII("error_console");
+ InstallUnpackedExtension(
+ extensions_data_dir.AppendASCII("runtime_and_manifest_errors"));
+}
+
void ExtensionSettingsUIBrowserTest::AddManagedPolicyProvider() {
auto* extension_service = extensions::ExtensionSystem::Get(GetProfile());
extension_service->management_policy()->RegisterProvider(&policy_provider_);
@@ -81,6 +93,19 @@ class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt {
}
};
+const Extension* ExtensionSettingsUIBrowserTest::InstallUnpackedExtension(
+ const base::FilePath& path) {
+ Profile* profile = this->GetProfile();
Dan Beam 2015/02/20 23:36:43 remove this-> and inline GetProfile() if it's pret
hcarmona 2015/02/21 00:16:01 Done.
+ ExtensionService* service =
+ extensions::ExtensionSystem::Get(profile)->extension_service();
+
+ extensions::UnpackedInstaller::Create(service)->Load(path);
+
+ if (!observer_->WaitForExtensionViewsToLoad())
+ return NULL;
Dan Beam 2015/02/20 23:36:43 where do we care about the return value? wouldn't
hcarmona 2015/02/21 00:16:01 Changed to void. Most tests will still pass if thi
Dan Beam 2015/02/21 00:26:10 wait, what? why would we ever want to say Install
hcarmona 2015/02/23 22:25:07 Updated so that it will fail the test if we cannot
+ return service->GetExtensionById(last_loaded_extension_id(), false);
+}
+
const Extension* ExtensionSettingsUIBrowserTest::InstallExtension(
const base::FilePath& path) {
Profile* profile = this->GetProfile();

Powered by Google App Engine
This is Rietveld 408576698