| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
| 6 | 6 |
| 7 #include "crypto/rsa_private_key.h" | 7 #include "crypto/rsa_private_key.h" |
| 8 #include "crypto/signature_creator.h" | 8 #include "crypto/signature_creator.h" |
| 9 #include "net/base/default_origin_bound_cert_store.h" | 9 #include "net/base/default_origin_bound_cert_store.h" |
| 10 #include "net/http/http_response_headers.h" | 10 #include "net/http/http_response_headers.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 scoped_ptr<OriginBoundCertService> obc_service( | 277 scoped_ptr<OriginBoundCertService> obc_service( |
| 278 new OriginBoundCertService(new DefaultOriginBoundCertStore(NULL))); | 278 new OriginBoundCertService(new DefaultOriginBoundCertStore(NULL))); |
| 279 std::string cert; | 279 std::string cert; |
| 280 std::string proof; | 280 std::string proof; |
| 281 GetOriginBoundCertAndProof("http://www.gmail.com/", obc_service.get(), | 281 GetOriginBoundCertAndProof("http://www.gmail.com/", obc_service.get(), |
| 282 &cert, &proof); | 282 &cert, &proof); |
| 283 | 283 |
| 284 spdy::SpdyCredential cred; | 284 spdy::SpdyCredential cred; |
| 285 cred.slot = 1; | 285 cred.slot = 1; |
| 286 cred.origin = "http://www.gmail.com"; | |
| 287 cred.proof = proof; | 286 cred.proof = proof; |
| 288 cred.certs.push_back(cert); | 287 cred.certs.push_back(cert); |
| 289 | 288 |
| 290 scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); | 289 scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); |
| 291 scoped_ptr<spdy::SpdyFrame> credential(ConstructSpdyCredential(cred)); | 290 scoped_ptr<spdy::SpdyFrame> credential(ConstructSpdyCredential(cred)); |
| 292 scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet("http://www.gmail.com", | 291 scoped_ptr<spdy::SpdyFrame> req2(ConstructSpdyGet("http://www.gmail.com", |
| 293 false, 3, LOWEST)); | 292 false, 3, LOWEST)); |
| 294 MockWrite writes[] = { | 293 MockWrite writes[] = { |
| 295 CreateMockWrite(*req.get(), 0), | 294 CreateMockWrite(*req.get(), 0), |
| 296 CreateMockWrite(*credential.get(), 2), | 295 CreateMockWrite(*credential.get(), 2), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 ASSERT_TRUE(response.headers.get() != NULL); | 391 ASSERT_TRUE(response.headers.get() != NULL); |
| 393 ASSERT_EQ(200, response.headers->response_code()); | 392 ASSERT_EQ(200, response.headers->response_code()); |
| 394 } | 393 } |
| 395 | 394 |
| 396 #endif // !defined(USE_OPENSSL) | 395 #endif // !defined(USE_OPENSSL) |
| 397 | 396 |
| 398 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 397 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
| 399 // methods. | 398 // methods. |
| 400 | 399 |
| 401 } // namespace net | 400 } // namespace net |
| OLD | NEW |