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

Unified Diff: blimp/client/session/assignment_source_unittest.cc

Issue 1958033003: Allows client to access auth token from command line specified file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed kmarshall's comments Created 4 years, 7 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
Index: blimp/client/session/assignment_source_unittest.cc
diff --git a/blimp/client/session/assignment_source_unittest.cc b/blimp/client/session/assignment_source_unittest.cc
index 440b4dfe2ed8aa76eb8c24cbd2ff3aab567de5be..883e03ebc061e688811995ba7ca2e6d8864b2713 100644
--- a/blimp/client/session/assignment_source_unittest.cc
+++ b/blimp/client/session/assignment_source_unittest.cc
@@ -16,6 +16,8 @@
#include "base/thread_task_runner_handle.h"
#include "base/values.h"
#include "blimp/client/app/blimp_client_switches.h"
+#include "blimp/common/fake_commandline.h"
+#include "blimp/common/get_client_token.h"
#include "blimp/common/protocol_version.h"
#include "components/safe_json/testing_json_parser.h"
#include "net/base/test_data_directory.h"
@@ -82,6 +84,8 @@ class AssignmentSourceTest : public testing::Test {
ASSERT_FALSE(cert_list.empty());
cert_ = std::move(cert_list[0]);
ASSERT_TRUE(cert_);
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
Kevin M 2016/05/11 00:39:57 See what we're doing with kCertRelativePath to get
CJ 2016/05/11 23:48:49 Done.
+ CreateFileForSwitch(engine::kClientTokenPath, kTestClientToken);
}
// This expects the AssignmentSource::GetAssignment to return a custom
@@ -196,10 +200,11 @@ AssignmentSourceTest::BuildAssignerResponse() {
}
TEST_F(AssignmentSourceTest, TestTCPAlternateEndpointSuccess) {
+ auto cmd_line = CreateCommandLine(all_filepath_switches_);
Assignment assignment;
assignment.transport_protocol = Assignment::TransportProtocol::TCP;
assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort);
- assignment.client_token = kDummyClientToken;
+ assignment.client_token = GetClientToken(cmd_line);
assignment.cert = scoped_refptr<net::X509Certificate>(nullptr);
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
@@ -217,10 +222,11 @@ TEST_F(AssignmentSourceTest, TestTCPAlternateEndpointSuccess) {
}
TEST_F(AssignmentSourceTest, TestSSLAlternateEndpointSuccess) {
+ auto cmd_line = CreateCommandLine(all_filepath_switches_);
Assignment assignment;
assignment.transport_protocol = Assignment::TransportProtocol::SSL;
assignment.engine_endpoint = net::IPEndPoint(kTestIpAddress, kTestPort);
- assignment.client_token = kDummyClientToken;
+ assignment.client_token = GetClientToken(cmd_line);
assignment.cert = cert_;
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(

Powered by Google App Engine
This is Rietveld 408576698