Commit 2c354769 authored by munjal@chromium.org's avatar munjal@chromium.org

Fix some oauth2 test code: put most code in anonymous namespace to avoid

ODR violations.
Review URL: https://chromiumcodereview.appspot.com/10389220

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137987 0039d316-1c4b-4281-b951-d872f2087c98
parent dac48051
......@@ -35,6 +35,7 @@ using testing::_;
using testing::Return;
namespace {
typedef std::vector<std::string> ScopeList;
static const char kValidTokenResponse[] =
......@@ -48,7 +49,6 @@ static const char kTokenResponseNoAccessToken[] =
" \"expires_in\": 3600,"
" \"token_type\": \"Bearer\""
"}";
}
class MockUrlFetcherFactory : public ScopedURLFetcherFactory,
public URLFetcherFactory {
......@@ -76,6 +76,8 @@ class MockOAuth2AccessTokenConsumer : public OAuth2AccessTokenConsumer {
void(const GoogleServiceAuthError& error));
};
} // namespace
class OAuth2AccessTokenFetcherTest : public testing::Test {
public:
OAuth2AccessTokenFetcherTest()
......
......@@ -34,6 +34,7 @@ using testing::_;
using testing::Return;
namespace {
static std::string CreateBody() {
return "some body";
}
......@@ -49,8 +50,6 @@ static std::vector<std::string> CreateTestScopes() {
return scopes;
}
} // namespace
class MockUrlFetcherFactory : public ScopedURLFetcherFactory,
public URLFetcherFactory {
public:
......@@ -103,6 +102,8 @@ class MockApiCallFlow : public OAuth2ApiCallFlow {
MOCK_METHOD0(CreateAccessTokenFetcher, OAuth2AccessTokenFetcher* ());
};
} // namespace
class OAuth2ApiCallFlowTest : public testing::Test {
public:
OAuth2ApiCallFlowTest() {}
......
......@@ -36,6 +36,7 @@ using testing::_;
using testing::Return;
namespace {
static const char kValidTokenResponse[] =
"{"
" \"token\": \"at1\","
......@@ -45,7 +46,6 @@ static const char kTokenResponseNoAccessToken[] =
"{"
" \"issueAdvice\": \"Auto\""
"}";
}
class MockUrlFetcherFactory : public ScopedURLFetcherFactory,
public URLFetcherFactory {
......@@ -73,6 +73,8 @@ class MockOAuth2MintTokenConsumer : public OAuth2MintTokenConsumer {
void(const GoogleServiceAuthError& error));
};
} // namespace
class OAuth2MintTokenFetcherTest : public testing::Test {
public:
OAuth2MintTokenFetcherTest()
......
......@@ -119,8 +119,6 @@ static IssueAdviceInfo CreateIssueAdvice() {
return ia;
}
} // namespace
class MockDelegate : public OAuth2MintTokenFlow::Delegate {
public:
MockDelegate() {}
......@@ -144,6 +142,8 @@ class MockMintTokenFlow : public OAuth2MintTokenFlow {
MOCK_METHOD0(CreateMintTokenFetcher, OAuth2MintTokenFetcher*());
};
} // namespace
class OAuth2MintTokenFlowTest : public testing::Test {
public:
OAuth2MintTokenFlowTest() {}
......
......@@ -62,7 +62,7 @@ class MockOAuth2RevocationConsumer : public OAuth2RevocationConsumer {
void(const GoogleServiceAuthError& error));
};
}
} // namespace
class OAuth2RevocationFetcherTest : public testing::Test {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment