From 308acc09bfaf6dabf4b6d5f5e39f33854df8ce34 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Wed, 21 Mar 2018 11:04:40 -0400 Subject: Change CredentialsProvider::TokenListener to use StatusOr (#945) * Change CredentialsProvider::TokenListener to use StatusOr Rather than a token plus error code/msg. * Eliminate the concept of an invalid Token Instead, we'll just use StatusOr. Note that unauthenticated tokens are handled as a special case; they're created via: Token::Unauthenticated() and are otherwise "valid", though attempting to retrieve the raw token on one of these tokens will cause an assertion failure. --- Firestore/core/test/firebase/firestore/auth/token_test.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Firestore/core/test/firebase/firestore/auth/token_test.cc') diff --git a/Firestore/core/test/firebase/firestore/auth/token_test.cc b/Firestore/core/test/firebase/firestore/auth/token_test.cc index 8f784d6..e34053e 100644 --- a/Firestore/core/test/firebase/firestore/auth/token_test.cc +++ b/Firestore/core/test/firebase/firestore/auth/token_test.cc @@ -26,14 +26,12 @@ TEST(Token, Getter) { Token token("token", User("abc")); EXPECT_EQ("token", token.token()); EXPECT_EQ(User("abc"), token.user()); - EXPECT_TRUE(token.is_valid()); } -TEST(Token, InvalidToken) { - const Token& token = Token::Invalid(); +TEST(Token, UnauthenticatedToken) { + const Token& token = Token::Unauthenticated(); EXPECT_ANY_THROW(token.token()); EXPECT_EQ(User::Unauthenticated(), token.user()); - EXPECT_FALSE(token.is_valid()); } } // namespace auth -- cgit v1.2.3