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

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

Issue 1047943002: Cache --whitelisted-extension-id in SimpleFeature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set command line switch in SetUp instead of SetUpTestCase. Created 5 years, 9 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/permission_message_combinations_unittest.cc
diff --git a/chrome/browser/extensions/permission_message_combinations_unittest.cc b/chrome/browser/extensions/permission_message_combinations_unittest.cc
index 7581ff1d42618ca91b4167cdc2b85899086ceaf3..819c52dc7a6c5f53b0da40d6f3a66d79d19cc02f 100644
--- a/chrome/browser/extensions/permission_message_combinations_unittest.cc
+++ b/chrome/browser/extensions/permission_message_combinations_unittest.cc
@@ -29,20 +29,27 @@ class PermissionMessageCombinationsUnittest : public testing::Test {
testing::Test::SetUp();
// Force creation of ExtensionPrefs before adding extensions.
env_.GetExtensionPrefs();
+
+ // Whitelist a known extension id so we can test all permissions. This ID
+ // will be used for each test app.
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kWhitelistedExtensionID, "ahplfneplbnjcflhdgkkjeiglkkfeelb");
}
protected:
// Create and install an app or extension with the given manifest JSON string.
// Single-quotes in the string will be replaced with double quotes.
void CreateAndInstall(const std::string& json_manifest) {
- std::string json_manifest_with_double_quotes = json_manifest;
+ // Add the manifest key so that the ID will be the whitelisted ID.
+ std::string json_manifest_with_key = json_manifest;
+ json_manifest_with_key.replace(json_manifest.length() - 1,
+ json_manifest.length(),
+ ",'key': 'd2hpdGVsaXN0IG1l'}");
not at google - send to devlin 2015/04/02 14:31:57 Voodoo... I suppose the 'd2hpdGVsaXN0IG1l' corresp
jackhou1 2015/04/07 23:46:21 Done.
+ std::string json_manifest_with_double_quotes = json_manifest_with_key;
std::replace(json_manifest_with_double_quotes.begin(),
json_manifest_with_double_quotes.end(), '\'', '"');
app_ = env_.MakeExtension(
*base::test::ParseJson(json_manifest_with_double_quotes));
- // Add the app to any whitelists so we can test all permissions.
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kWhitelistedExtensionID, app_->id());
}
// Checks whether the currently installed app or extension produces the given

Powered by Google App Engine
This is Rietveld 408576698