aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-03-21 11:04:40 -0400
committerGravatar GitHub <noreply@github.com>2018-03-21 11:04:40 -0400
commit308acc09bfaf6dabf4b6d5f5e39f33854df8ce34 (patch)
tree3706bbbe40d08569795634fd2f30a07fd348b399 /Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc
parentd924771453d000e708bd5d239da3bae4feb489ac (diff)
Change CredentialsProvider::TokenListener to use StatusOr<Token> (#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<Token>. 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.
Diffstat (limited to 'Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc')
-rw-r--r--Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc b/Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc
index 3b487f3..60845e5 100644
--- a/Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc
+++ b/Firestore/core/test/firebase/firestore/auth/empty_credentials_provider_test.cc
@@ -16,6 +16,7 @@
#include "Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h"
+#include "Firestore/core/src/firebase/firestore/util/statusor.h"
#include "gtest/gtest.h"
namespace firebase {
@@ -25,14 +26,13 @@ namespace auth {
TEST(EmptyCredentialsProvider, GetToken) {
EmptyCredentialsProvider credentials_provider;
credentials_provider.GetToken(
- /*force_refresh=*/true, [](Token token, const int64_t error_code,
- const absl::string_view error_msg) {
- EXPECT_FALSE(token.is_valid());
+ /*force_refresh=*/true, [](util::StatusOr<Token> result) {
+ EXPECT_TRUE(result.ok());
+ const Token& token = result.ValueOrDie();
+ EXPECT_ANY_THROW(token.token());
const User& user = token.user();
EXPECT_EQ("", user.uid());
EXPECT_FALSE(user.is_authenticated());
- EXPECT_EQ(FirestoreErrorCode::Ok, error_code);
- EXPECT_EQ("", error_msg);
});
}