Chromium Code Reviews| Index: chrome/browser/extensions/crx_installer_browsertest.cc |
| diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc |
| index 3bef3d6ada0a9620c23d489d7a38f6b01a43becc..a5ff309c1c5268c0e10ef418e74e68c8ef3c90de 100644 |
| --- a/chrome/browser/extensions/crx_installer_browsertest.cc |
| +++ b/chrome/browser/extensions/crx_installer_browsertest.cc |
| @@ -564,4 +564,27 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, ManagementPolicy) { |
| EXPECT_FALSE(InstallExtension(crx_path, 0)); |
| } |
| +IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, WithheldElevationCheck) { |
| + // Enable consent flag and install extension. All host permissions will be |
|
Devlin
2014/09/09 16:04:26
This is actually wrong. It's not that "All host p
gpdavis
2014/09/09 17:48:53
Ah, understood. Will change.
|
| + // withheld. |
| + scoped_ptr<FeatureSwitch::ScopedOverride> enable_scripts_switch( |
| + new FeatureSwitch::ScopedOverride( |
| + FeatureSwitch::scripts_require_action(), true)); |
| + |
| + base::FilePath crx_path = test_data_dir_.AppendASCII("withheld.crx"); |
|
Devlin
2014/09/09 16:04:26
If we can, let's avoid introducing more crxs into
gpdavis
2014/09/09 17:48:53
Sure thing.
|
| + const extensions::Extension* extension = InstallExtension(crx_path, 1); |
| + EXPECT_TRUE(base::PathExists(extension->path())); |
| + |
| + std::string id = extension->id(); |
| + ExtensionService* service = extensions::ExtensionSystem::Get( |
| + browser()->profile())->extension_service(); |
| + EXPECT_TRUE(service->GetExtensionById(id, false)); |
|
Devlin
2014/09/09 16:04:26
This really and truly and honestly is fully deprec
gpdavis
2014/09/09 17:48:53
Ah, sorry about that. I borrowed code from anothe
|
| + |
| + // Disable consent flag and reinstall extension. It should now be disabled |
| + // because previously withheld permissions are now being requested. |
| + enable_scripts_switch.reset(); |
| + extension = InstallExtension(crx_path, -1); |
| + EXPECT_FALSE(service->IsExtensionEnabled(id)); |
| +} |
| + |
| } // namespace extensions |