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

Side by Side Diff: google_apis/gaia/merge_session_helper_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: rebased 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
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // We can EXPECT_* to be zero at the end of our unit tests 43 // We can EXPECT_* to be zero at the end of our unit tests
44 // to make sure everything is properly deleted. 44 // to make sure everything is properly deleted.
45 45
46 int total = 0; 46 int total = 0;
47 47
48 class InstrumentedMergeSessionHelper : public MergeSessionHelper { 48 class InstrumentedMergeSessionHelper : public MergeSessionHelper {
49 public: 49 public:
50 InstrumentedMergeSessionHelper( 50 InstrumentedMergeSessionHelper(
51 OAuth2TokenService* token_service, 51 OAuth2TokenService* token_service,
52 net::URLRequestContextGetter* request_context) : 52 net::URLRequestContextGetter* request_context) :
53 MergeSessionHelper(token_service, request_context, NULL) { 53 MergeSessionHelper(token_service, GaiaConstants::kChromeSource,
54 request_context, NULL) {
54 total++; 55 total++;
55 } 56 }
56 57
57 virtual ~InstrumentedMergeSessionHelper() { 58 virtual ~InstrumentedMergeSessionHelper() {
58 total--; 59 total--;
59 } 60 }
60 61
61 MOCK_METHOD0(StartFetching, void()); 62 MOCK_METHOD0(StartFetching, void());
62 MOCK_METHOD0(StartLogOutUrlFetch, void()); 63 MOCK_METHOD0(StartLogOutUrlFetch, void());
63 64
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 MergeSessionHelper::ExternalCcResultFetcher::URLToTokenAndFetcher fetchers = 402 MergeSessionHelper::ExternalCcResultFetcher::URLToTokenAndFetcher fetchers =
402 result_fetcher.get_fetcher_map_for_testing(); 403 result_fetcher.get_fetcher_map_for_testing();
403 ASSERT_EQ(1u, fetchers.size()); 404 ASSERT_EQ(1u, fetchers.size());
404 ASSERT_EQ(1u, fetchers.count(GURL("http://www.yt.com"))); 405 ASSERT_EQ(1u, fetchers.count(GURL("http://www.yt.com")));
405 406
406 // Simulate response for "yt" with a string that is too long. 407 // Simulate response for "yt" with a string that is too long.
407 SimulateGetCheckConnctionInfoResult( 408 SimulateGetCheckConnctionInfoResult(
408 fetchers[GURL("http://www.yt.com")].second, "1234567890123456trunc"); 409 fetchers[GURL("http://www.yt.com")].second, "1234567890123456trunc");
409 ASSERT_EQ("yt:1234567890123456", result_fetcher.GetExternalCcResult()); 410 ASSERT_EQ("yt:1234567890123456", result_fetcher.GetExternalCcResult());
410 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698