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

Unified Diff: remoting/host/token_validator_factory_impl_unittest.cc

Issue 48713008: [sync] Allow FakeURLFetcher to return arbitrary HTTP response codes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/test_url_fetcher_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/token_validator_factory_impl_unittest.cc
diff --git a/remoting/host/token_validator_factory_impl_unittest.cc b/remoting/host/token_validator_factory_impl_unittest.cc
index fa30d8ff0a627a9fccd58401a3f3c4038f222d1c..1eb14f717943681809ca8f095c7859dc66076809 100644
--- a/remoting/host/token_validator_factory_impl_unittest.cc
+++ b/remoting/host/token_validator_factory_impl_unittest.cc
@@ -8,6 +8,7 @@
#include "base/json/json_writer.h"
#include "base/values.h"
+#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
#include "remoting/base/rsa_key_pair.h"
@@ -94,7 +95,7 @@ TEST_F(TokenValidatorFactoryImplTest, Success) {
token_validator_ = token_validator_factory_->CreateTokenValidator(
kLocalJid, kRemoteJid);
factory.SetFakeResponse(GURL(kTokenValidationUrl), CreateResponse(
- token_validator_->token_scope()), true);
+ token_validator_->token_scope()), net::HTTP_OK);
token_validator_->ValidateThirdPartyToken(
kToken, base::Bind(&TokenValidatorFactoryImplTest::SuccessCallback,
base::Unretained(this)));
@@ -105,7 +106,9 @@ TEST_F(TokenValidatorFactoryImplTest, BadToken) {
net::FakeURLFetcherFactory factory(NULL);
token_validator_ = token_validator_factory_->CreateTokenValidator(
kLocalJid, kRemoteJid);
- factory.SetFakeResponse(GURL(kTokenValidationUrl), std::string(), false);
+ factory.SetFakeResponse(GURL(kTokenValidationUrl),
+ std::string(),
+ net::HTTP_INTERNAL_SERVER_ERROR);
token_validator_->ValidateThirdPartyToken(
kToken, base::Bind(&TokenValidatorFactoryImplTest::FailureCallback,
base::Unretained(this)));
@@ -117,7 +120,7 @@ TEST_F(TokenValidatorFactoryImplTest, BadScope) {
token_validator_ = token_validator_factory_->CreateTokenValidator(
kLocalJid, kRemoteJid);
factory.SetFakeResponse(
- GURL(kTokenValidationUrl), CreateResponse(kBadScope), true);
+ GURL(kTokenValidationUrl), CreateResponse(kBadScope), net::HTTP_OK);
token_validator_->ValidateThirdPartyToken(
kToken, base::Bind(&TokenValidatorFactoryImplTest::FailureCallback,
base::Unretained(this)));
@@ -128,7 +131,9 @@ TEST_F(TokenValidatorFactoryImplTest, DeleteOnFailure) {
net::FakeURLFetcherFactory factory(NULL);
token_validator_ = token_validator_factory_->CreateTokenValidator(
kLocalJid, kRemoteJid);
- factory.SetFakeResponse(GURL(kTokenValidationUrl), std::string(), false);
+ factory.SetFakeResponse(GURL(kTokenValidationUrl),
+ std::string(),
+ net::HTTP_INTERNAL_SERVER_ERROR);
token_validator_->ValidateThirdPartyToken(
kToken, base::Bind(
&TokenValidatorFactoryImplTest::DeleteOnFailureCallback,
« no previous file with comments | « net/url_request/test_url_fetcher_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698