| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "net/http/mock_sspi_library_win.h" | 5 #include "net/http/mock_sspi_library_win.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 unsigned long TargetDataRep, | 40 unsigned long TargetDataRep, |
| 41 PSecBufferDesc pInput, | 41 PSecBufferDesc pInput, |
| 42 unsigned long Reserved2, | 42 unsigned long Reserved2, |
| 43 PCtxtHandle phNewContext, | 43 PCtxtHandle phNewContext, |
| 44 PSecBufferDesc pOutput, | 44 PSecBufferDesc pOutput, |
| 45 unsigned long* contextAttr, | 45 unsigned long* contextAttr, |
| 46 PTimeStamp ptsExpiry) { | 46 PTimeStamp ptsExpiry) { |
| 47 // Fill in the outbound buffer with garbage data. | 47 // Fill in the outbound buffer with garbage data. |
| 48 PSecBuffer out_buffer = pOutput->pBuffers; | 48 PSecBuffer out_buffer = pOutput->pBuffers; |
| 49 out_buffer->cbBuffer = 2; | 49 out_buffer->cbBuffer = 2; |
| 50 uint8* buf = reinterpret_cast<uint8 *>(out_buffer->pvBuffer); | 50 uint8_t* buf = reinterpret_cast<uint8_t*>(out_buffer->pvBuffer); |
| 51 buf[0] = 0xAB; | 51 buf[0] = 0xAB; |
| 52 buf[1] = 0xBA; | 52 buf[1] = 0xBA; |
| 53 | 53 |
| 54 // Fill in phNewContext with arbitrary value if it's invalid. | 54 // Fill in phNewContext with arbitrary value if it's invalid. |
| 55 if (phNewContext != phContext) | 55 if (phNewContext != phContext) |
| 56 phNewContext->dwLower = phNewContext->dwUpper = ((ULONG_PTR) ((INT_PTR)0)); | 56 phNewContext->dwLower = phNewContext->dwUpper = ((ULONG_PTR) ((INT_PTR)0)); |
| 57 return SEC_E_OK; | 57 return SEC_E_OK; |
| 58 } | 58 } |
| 59 | 59 |
| 60 SECURITY_STATUS MockSSPILibrary::QuerySecurityPackageInfo( | 60 SECURITY_STATUS MockSSPILibrary::QuerySecurityPackageInfo( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void MockSSPILibrary::ExpectQuerySecurityPackageInfo( | 97 void MockSSPILibrary::ExpectQuerySecurityPackageInfo( |
| 98 const std::wstring& expected_package, | 98 const std::wstring& expected_package, |
| 99 SECURITY_STATUS response_code, | 99 SECURITY_STATUS response_code, |
| 100 PSecPkgInfoW package_info) { | 100 PSecPkgInfoW package_info) { |
| 101 PackageQuery package_query = {expected_package, response_code, | 101 PackageQuery package_query = {expected_package, response_code, |
| 102 package_info}; | 102 package_info}; |
| 103 expected_package_queries_.push_back(package_query); | 103 expected_package_queries_.push_back(package_query); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace net | 106 } // namespace net |
| OLD | NEW |