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

Unified Diff: remoting/test/app_remoting_test_driver_environment_unittest.cc

Issue 1237883002: Added chromoting test environment for the tests to share data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unittest, display connection stats ability, and error check for transition delay. Created 5 years, 5 months 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 | « remoting/test/BUILD.gn ('k') | remoting/test/chromoting_test_driver_environment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/app_remoting_test_driver_environment_unittest.cc
diff --git a/remoting/test/app_remoting_test_driver_environment_unittest.cc b/remoting/test/app_remoting_test_driver_environment_unittest.cc
index 07eb931826cd50d1a707953dd9d91e96c3f9f3c0..cf9a4ccbc3e55689ebefbf10d1129b31f8d897c6 100644
--- a/remoting/test/app_remoting_test_driver_environment_unittest.cc
+++ b/remoting/test/app_remoting_test_driver_environment_unittest.cc
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "remoting/test/fake_access_token_fetcher.h"
#include "remoting/test/fake_app_remoting_report_issue_request.h"
+#include "remoting/test/fake_refresh_token_store.h"
#include "remoting/test/fake_remote_host_info_fetcher.h"
#include "remoting/test/mock_access_token_fetcher.h"
#include "remoting/test/refresh_token_store.h"
@@ -17,7 +18,6 @@
namespace {
const char kAuthCodeValue[] = "4/892379827345jkefvkdfbv";
-const char kRefreshTokenValue[] = "1/lkjalseLKJlsiJgr45jbv";
const char kUserNameValue[] = "remoting_user@gmail.com";
const char kTestApplicationId[] = "sadlkjlsjgadjfgoajdfgagb";
const char kAnotherTestApplicationId[] = "waklgoisdhfnvjkdsfbljn";
@@ -31,67 +31,6 @@ namespace test {
using testing::_;
-// Stubs out the file API and returns fake data so we can remove
-// file system dependencies when testing the TestDriverEnvironment.
-class FakeRefreshTokenStore : public RefreshTokenStore {
- public:
- FakeRefreshTokenStore();
- ~FakeRefreshTokenStore() override;
-
- // RefreshTokenStore interface.
- std::string FetchRefreshToken() override;
- bool StoreRefreshToken(const std::string& refresh_token) override;
-
- bool refresh_token_write_attempted() const {
- return refresh_token_write_attempted_;
- }
-
- const std::string& stored_refresh_token_value() const {
- return stored_refresh_token_value_;
- }
-
- void set_refresh_token_value(const std::string& new_token_value) {
- refresh_token_value_ = new_token_value;
- }
-
- void set_refresh_token_write_succeeded(bool write_succeeded) {
- refresh_token_write_succeeded_ = write_succeeded;
- }
-
- private:
- // Control members used to return specific data to the caller.
- std::string refresh_token_value_;
- bool refresh_token_write_succeeded_;
-
- // Verification members to observe the value of the data being written.
- bool refresh_token_write_attempted_;
- std::string stored_refresh_token_value_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeRefreshTokenStore);
-};
-
-FakeRefreshTokenStore::FakeRefreshTokenStore()
- : refresh_token_value_(kRefreshTokenValue),
- refresh_token_write_succeeded_(true),
- refresh_token_write_attempted_(false) {
-}
-
-FakeRefreshTokenStore::~FakeRefreshTokenStore() {
-}
-
-std::string FakeRefreshTokenStore::FetchRefreshToken() {
- return refresh_token_value_;
-}
-
-bool FakeRefreshTokenStore::StoreRefreshToken(
- const std::string& refresh_token) {
- // Record the information passed to us to write.
- refresh_token_write_attempted_ = true;
- stored_refresh_token_value_ = refresh_token;
-
- return refresh_token_write_succeeded_;
-}
-
class AppRemotingTestDriverEnvironmentTest : public ::testing::Test {
public:
AppRemotingTestDriverEnvironmentTest();
« no previous file with comments | « remoting/test/BUILD.gn ('k') | remoting/test/chromoting_test_driver_environment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698