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

Side by Side Diff: google_apis/gaia/ubertoken_fetcher_unittest.cc

Issue 601643002: Use a distinct source parameter on gaia endpoints for the reconcilor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@uber
Patch Set: Remove functions Created 6 years, 2 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
« no previous file with comments | « google_apis/gaia/ubertoken_fetcher.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "google_apis/gaia/ubertoken_fetcher.h" 5 #include "google_apis/gaia/ubertoken_fetcher.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "google_apis/gaia/fake_oauth2_token_service.h" 10 #include "google_apis/gaia/fake_oauth2_token_service.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 } // namespace 46 } // namespace
47 47
48 class UbertokenFetcherTest : public testing::Test { 48 class UbertokenFetcherTest : public testing::Test {
49 public: 49 public:
50 virtual void SetUp() OVERRIDE { 50 virtual void SetUp() OVERRIDE {
51 request_context_getter_ = new net::TestURLRequestContextGetter( 51 request_context_getter_ = new net::TestURLRequestContextGetter(
52 base::MessageLoopProxy::current()); 52 base::MessageLoopProxy::current());
53 fetcher_.reset(new UbertokenFetcher(&token_service_, 53 fetcher_.reset(new UbertokenFetcher(&token_service_,
54 &consumer_, 54 &consumer_,
55 GaiaConstants::kChromeSource,
55 request_context_getter_.get())); 56 request_context_getter_.get()));
56 } 57 }
57 58
58 virtual void TearDown() OVERRIDE { 59 virtual void TearDown() OVERRIDE {
59 fetcher_.reset(); 60 fetcher_.reset();
60 } 61 }
61 62
62 protected: 63 protected:
63 base::MessageLoop message_loop_; 64 base::MessageLoop message_loop_;
64 net::TestURLFetcherFactory factory_; 65 net::TestURLFetcherFactory factory_;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 EXPECT_EQ(0, consumer_.nb_error_); 163 EXPECT_EQ(0, consumer_.nb_error_);
163 EXPECT_EQ(0, consumer_.nb_correct_token_); 164 EXPECT_EQ(0, consumer_.nb_correct_token_);
164 EXPECT_EQ("", consumer_.last_token_); 165 EXPECT_EQ("", consumer_.last_token_);
165 166
166 fetcher_->OnGetTokenSuccess(NULL, "accessToken", base::Time()); 167 fetcher_->OnGetTokenSuccess(NULL, "accessToken", base::Time());
167 fetcher_->OnUberAuthTokenSuccess("uberToken"); 168 fetcher_->OnUberAuthTokenSuccess("uberToken");
168 EXPECT_EQ(0, consumer_.nb_error_); 169 EXPECT_EQ(0, consumer_.nb_error_);
169 EXPECT_EQ(1, consumer_.nb_correct_token_); 170 EXPECT_EQ(1, consumer_.nb_correct_token_);
170 EXPECT_EQ("uberToken", consumer_.last_token_); 171 EXPECT_EQ("uberToken", consumer_.last_token_);
171 } 172 }
OLDNEW
« no previous file with comments | « google_apis/gaia/ubertoken_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698