Chromium Code Reviews| Index: chrome/browser/extensions/api/identity/identity_apitest.cc |
| =================================================================== |
| --- chrome/browser/extensions/api/identity/identity_apitest.cc (revision 177049) |
| +++ 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" |
| @@ -25,18 +28,15 @@ |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| -using extensions::Extension; |
| -using extensions::IdentityGetAuthTokenFunction; |
| -using extensions::IdentityLaunchWebAuthFlowFunction; |
| using testing::_; |
| using testing::Return; |
| using testing::ReturnRef; |
| -namespace errors = extensions::identity_constants; |
| +namespace extensions { |
| + |
| +namespace errors = identity_constants; |
| namespace utils = extension_function_test_utils; |
| -namespace { |
| - |
| static const char kAccessToken[] = "auth_token"; |
| class TestLoginUI : public LoginUIService::LoginUI { |
| @@ -85,8 +85,6 @@ |
| OAuth2MintTokenFlow::Delegate* delegate_; |
| }; |
| -} // namespace |
| - |
| class MockGetAuthTokenFunction : public IdentityGetAuthTokenFunction { |
| public: |
| MockGetAuthTokenFunction() : install_ui_result_(false), |
| @@ -142,6 +140,12 @@ |
| }; |
| class GetAuthTokenFunctionTest : public ExtensionBrowserTest { |
| + public: |
| + virtual void SetUp() { |
|
Devlin
2013/01/17 10:04:59
virtual void SetUp() OVERRIDE {
SanjoyPal
2013/01/17 19:13:43
Done.
|
| + InProcessBrowserTest::SetUp(); |
|
Devlin
2013/01/17 10:04:59
Call the immediate super function (which should, i
SanjoyPal
2013/01/17 19:13:43
Done.
|
| + ManifestHandler::Register(extension_manifest_keys::kOAuth2, |
| + new OAuth2ManifestHandler); |
| + } |
| protected: |
| enum OAuth2Fields { |
| NONE = 0, |
| @@ -156,8 +160,8 @@ |
| const Extension* CreateExtension(int fields_to_set) { |
| const Extension* ext = LoadExtension( |
| test_data_dir_.AppendASCII("platform_apps/oauth2")); |
| - Extension::OAuth2Info& oauth2_info = const_cast<Extension::OAuth2Info&>( |
| - ext->oauth2_info()); |
| + OAuth2Info& oauth2_info = const_cast<OAuth2Info&>( |
| + OAuth2Info::GetOAuth2Info(ext)); |
| if ((fields_to_set & CLIENT_ID) != 0) |
| oauth2_info.client_id = "client1"; |
| if ((fields_to_set & SCOPES) != 0) { |
| @@ -412,7 +416,7 @@ |
| scoped_refptr<IdentityLaunchWebAuthFlowFunction> function( |
| new IdentityLaunchWebAuthFlowFunction()); |
| - scoped_refptr<extensions::Extension> empty_extension( |
| + scoped_refptr<Extension> empty_extension( |
| utils::CreateEmptyExtension()); |
| function->set_extension(empty_extension.get()); |
| std::string args = base::StringPrintf( |
| @@ -452,3 +456,5 @@ |
| "\"left\": 100, \"top\": 200, \"width\": 300, \"height\": 400", |
| 100, 200, 300, 400); |
| } |
| + |
| +} // namespace extensions |