fake_test_token_storage.cc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "remoting/test/fake_test_token_storage.h"
  5. #include "base/notreached.h"
  6. namespace {
  7. const char kRefreshTokenValue[] = "1/lkjalseLKJlsiJgr45jbv";
  8. }
  9. namespace remoting {
  10. namespace test {
  11. FakeTestTokenStorage::FakeTestTokenStorage()
  12. : refresh_token_value_(kRefreshTokenValue),
  13. refresh_token_write_succeeded_(true),
  14. refresh_token_write_attempted_(false) {}
  15. FakeTestTokenStorage::~FakeTestTokenStorage() = default;
  16. std::string FakeTestTokenStorage::FetchRefreshToken() {
  17. return refresh_token_value_;
  18. }
  19. bool FakeTestTokenStorage::StoreRefreshToken(const std::string& refresh_token) {
  20. // Record the information passed to us to write.
  21. refresh_token_write_attempted_ = true;
  22. stored_refresh_token_value_ = refresh_token;
  23. return refresh_token_write_succeeded_;
  24. }
  25. std::string FakeTestTokenStorage::FetchUserEmail() {
  26. NOTIMPLEMENTED();
  27. return "";
  28. }
  29. bool FakeTestTokenStorage::StoreUserEmail(const std::string& user_email) {
  30. NOTIMPLEMENTED();
  31. return false;
  32. }
  33. std::string FakeTestTokenStorage::FetchAccessToken() {
  34. NOTIMPLEMENTED();
  35. return "";
  36. }
  37. bool FakeTestTokenStorage::StoreAccessToken(const std::string& access_token) {
  38. NOTIMPLEMENTED();
  39. return false;
  40. }
  41. std::string FakeTestTokenStorage::FetchDeviceId() {
  42. NOTIMPLEMENTED();
  43. return "";
  44. }
  45. bool FakeTestTokenStorage::StoreDeviceId(const std::string& device_id) {
  46. NOTIMPLEMENTED();
  47. return false;
  48. }
  49. } // namespace test
  50. } // namespace remoting