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

Side by Side Diff: chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc

Issue 10389220: Fix some oauth2 test code: put most code in anonymous namespace to avoid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A complete set of unit tests for OAuth2RevocationFetcher. 5 // A complete set of unit tests for OAuth2RevocationFetcher.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class MockOAuth2RevocationConsumer : public OAuth2RevocationConsumer { 55 class MockOAuth2RevocationConsumer : public OAuth2RevocationConsumer {
56 public: 56 public:
57 MockOAuth2RevocationConsumer() {} 57 MockOAuth2RevocationConsumer() {}
58 ~MockOAuth2RevocationConsumer() {} 58 ~MockOAuth2RevocationConsumer() {}
59 59
60 MOCK_METHOD0(OnRevocationSuccess, void()); 60 MOCK_METHOD0(OnRevocationSuccess, void());
61 MOCK_METHOD1(OnRevocationFailure, 61 MOCK_METHOD1(OnRevocationFailure,
62 void(const GoogleServiceAuthError& error)); 62 void(const GoogleServiceAuthError& error));
63 }; 63 };
64 64
65 } 65 } // namespace
66 66
67 class OAuth2RevocationFetcherTest : public testing::Test { 67 class OAuth2RevocationFetcherTest : public testing::Test {
68 public: 68 public:
69 OAuth2RevocationFetcherTest() 69 OAuth2RevocationFetcherTest()
70 : ui_thread_(BrowserThread::UI, &message_loop_), 70 : ui_thread_(BrowserThread::UI, &message_loop_),
71 fetcher_(&consumer_, profile_.GetRequestContext()) { 71 fetcher_(&consumer_, profile_.GetRequestContext()) {
72 } 72 }
73 73
74 virtual ~OAuth2RevocationFetcherTest() { } 74 virtual ~OAuth2RevocationFetcherTest() { }
75 75
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 fetcher_.Start("access_token", "client_id", "origin"); 111 fetcher_.Start("access_token", "client_id", "origin");
112 fetcher_.OnURLFetchComplete(url_fetcher); 112 fetcher_.OnURLFetchComplete(url_fetcher);
113 } 113 }
114 114
115 TEST_F(OAuth2RevocationFetcherTest, Success) { 115 TEST_F(OAuth2RevocationFetcherTest, Success) {
116 TestURLFetcher* url_fetcher = SetupRevocation(true, net::HTTP_NO_CONTENT); 116 TestURLFetcher* url_fetcher = SetupRevocation(true, net::HTTP_NO_CONTENT);
117 EXPECT_CALL(consumer_, OnRevocationSuccess()).Times(1); 117 EXPECT_CALL(consumer_, OnRevocationSuccess()).Times(1);
118 fetcher_.Start("access_token", "client_id", "origin"); 118 fetcher_.Start("access_token", "client_id", "origin");
119 fetcher_.OnURLFetchComplete(url_fetcher); 119 fetcher_.OnURLFetchComplete(url_fetcher);
120 } 120 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698