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

Unified Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 11882025: Move "oauth2" manifest key parsing out of Extension class. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 11 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/api/identity/identity_apitest.cc
===================================================================
--- chrome/browser/extensions/api/identity/identity_apitest.cc (revision 176209)
+++ chrome/browser/extensions/api/identity/identity_apitest.cc (working copy)
@@ -15,6 +15,9 @@
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_handler.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
@@ -154,15 +157,17 @@
// Helper to create an extension with specific OAuth2Info fields set.
// |fields_to_set| should be computed by using fields of Oauth2Fields enum.
const Extension* CreateExtension(int fields_to_set) {
+ extensions::ManifestHandler::Register(extension_manifest_keys::kOAuth2,
+ new extensions::OAuth2ManifestHandler);
Devlin 2013/01/14 20:18:34 Indentation.
SanjoyPal 2013/01/16 19:10:52 Done.
const Extension* ext = LoadExtension(
test_data_dir_.AppendASCII("platform_apps/oauth2"));
- Extension::OAuth2Info& oauth2_info = const_cast<Extension::OAuth2Info&>(
- ext->oauth2_info());
+ extensions::OAuth2Info* oauth2_info = const_cast<extensions::OAuth2Info*>(
+ extensions::OAuth2Info::GetOAuth2Info(ext));
if ((fields_to_set & CLIENT_ID) != 0)
- oauth2_info.client_id = "client1";
+ oauth2_info->client_id = "client1";
if ((fields_to_set & SCOPES) != 0) {
- oauth2_info.scopes.push_back("scope1");
- oauth2_info.scopes.push_back("scope2");
+ oauth2_info->scopes.push_back("scope1");
+ oauth2_info->scopes.push_back("scope2");
}
return ext;
}

Powered by Google App Engine
This is Rietveld 408576698