OLD | NEW |
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 #include "chrome/browser/sync/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 fake_factory_->SetFakeResponse( | 455 fake_factory_->SetFakeResponse( |
456 GaiaUrls::GetInstance()->oauth2_token_url(), | 456 GaiaUrls::GetInstance()->oauth2_token_url(), |
457 "{" | 457 "{" |
458 " \"refresh_token\": \"rt1\"," | 458 " \"refresh_token\": \"rt1\"," |
459 " \"access_token\": \"at1\"," | 459 " \"access_token\": \"at1\"," |
460 " \"expires_in\": 3600," | 460 " \"expires_in\": 3600," |
461 " \"token_type\": \"Bearer\"" | 461 " \"token_type\": \"Bearer\"" |
462 "}", | 462 "}", |
463 true); | 463 true); |
464 fake_factory_->SetFakeResponse( | 464 fake_factory_->SetFakeResponse( |
465 GaiaUrls::GetInstance()->client_oauth_url(), | |
466 "{" | |
467 " \"oauth2\": {" | |
468 " \"refresh_token\": \"rt1\"," | |
469 " \"access_token\": \"at1\"," | |
470 " \"expires_in\": 3600," | |
471 " \"token_type\": \"Bearer\"" | |
472 " }" | |
473 "}", | |
474 true); | |
475 fake_factory_->SetFakeResponse( | |
476 GaiaUrls::GetInstance()->oauth1_login_url(), | 465 GaiaUrls::GetInstance()->oauth1_login_url(), |
477 "SID=sid\nLSID=lsid\nAuth=auth_token", | 466 "SID=sid\nLSID=lsid\nAuth=auth_token", |
478 true); | 467 true); |
479 } | 468 } |
480 | 469 |
481 void SyncTest::ClearMockGaiaResponses() { | 470 void SyncTest::ClearMockGaiaResponses() { |
482 // Clear any mock gaia responses that might have been set. | 471 // Clear any mock gaia responses that might have been set. |
483 if (fake_factory_.get()) { | 472 if (fake_factory_.get()) { |
484 fake_factory_->ClearFakeResponses(); | 473 fake_factory_->ClearFakeResponses(); |
485 fake_factory_.reset(); | 474 fake_factory_.reset(); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 | 837 |
849 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, | 838 void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, |
850 const net::ProxyConfig& proxy_config) { | 839 const net::ProxyConfig& proxy_config) { |
851 base::WaitableEvent done(false, false); | 840 base::WaitableEvent done(false, false); |
852 BrowserThread::PostTask( | 841 BrowserThread::PostTask( |
853 BrowserThread::IO, FROM_HERE, | 842 BrowserThread::IO, FROM_HERE, |
854 base::Bind(&SetProxyConfigCallback, &done, | 843 base::Bind(&SetProxyConfigCallback, &done, |
855 make_scoped_refptr(context_getter), proxy_config)); | 844 make_scoped_refptr(context_getter), proxy_config)); |
856 done.Wait(); | 845 done.Wait(); |
857 } | 846 } |
OLD | NEW |