| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // A set of unit tests for TokenValidatorFactoryImpl | 5 // A set of unit tests for TokenValidatorFactoryImpl |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "googleurl/src/gurl.h" | |
| 12 #include "net/url_request/test_url_fetcher_factory.h" | 11 #include "net/url_request/test_url_fetcher_factory.h" |
| 13 #include "net/url_request/url_request_test_util.h" | 12 #include "net/url_request/url_request_test_util.h" |
| 14 #include "remoting/base/rsa_key_pair.h" | 13 #include "remoting/base/rsa_key_pair.h" |
| 15 #include "remoting/base/test_rsa_key_pair.h" | 14 #include "remoting/base/test_rsa_key_pair.h" |
| 16 #include "remoting/host/token_validator_factory_impl.h" | 15 #include "remoting/host/token_validator_factory_impl.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const char kTokenUrl[] = "https://example.com/token"; | 21 const char kTokenUrl[] = "https://example.com/token"; |
| 22 const char kTokenValidationUrl[] = "https://example.com/validate"; | 22 const char kTokenValidationUrl[] = "https://example.com/validate"; |
| 23 const char kLocalJid[] = "user@example.com/local"; | 23 const char kLocalJid[] = "user@example.com/local"; |
| 24 const char kRemoteJid[] = "user@example.com/remote"; | 24 const char kRemoteJid[] = "user@example.com/remote"; |
| 25 const char kToken[] = "xyz123456"; | 25 const char kToken[] = "xyz123456"; |
| 26 const char kSharedSecret[] = "abcdefgh"; | 26 const char kSharedSecret[] = "abcdefgh"; |
| 27 | 27 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 kLocalJid, kRemoteJid); | 129 kLocalJid, kRemoteJid); |
| 130 factory.SetFakeResponse(kTokenValidationUrl, std::string(), false); | 130 factory.SetFakeResponse(kTokenValidationUrl, std::string(), false); |
| 131 token_validator_->ValidateThirdPartyToken( | 131 token_validator_->ValidateThirdPartyToken( |
| 132 kToken, base::Bind( | 132 kToken, base::Bind( |
| 133 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback, | 133 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback, |
| 134 base::Unretained(this))); | 134 base::Unretained(this))); |
| 135 message_loop_.Run(); | 135 message_loop_.Run(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace remoting | 138 } // namespace remoting |
| OLD | NEW |