| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 EXPECT_EQ(cookieUrl, cookie_store_->entries()[1].url); | 502 EXPECT_EQ(cookieUrl, cookie_store_->entries()[1].url); |
| 503 EXPECT_EQ("CR-test-httponly=1", cookie_store_->entries()[1].cookie_line); | 503 EXPECT_EQ("CR-test-httponly=1", cookie_store_->entries()[1].cookie_line); |
| 504 | 504 |
| 505 CloseWebSocketJob(); | 505 CloseWebSocketJob(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 TEST_F(WebSocketJobTest, HSTSUpgrade) { | 508 TEST_F(WebSocketJobTest, HSTSUpgrade) { |
| 509 GURL url("ws://upgrademe.com/"); | 509 GURL url("ws://upgrademe.com/"); |
| 510 MockSocketStreamDelegate delegate; | 510 MockSocketStreamDelegate delegate; |
| 511 scoped_refptr<SocketStreamJob> job = SocketStreamJob::CreateSocketStreamJob( | 511 scoped_refptr<SocketStreamJob> job = SocketStreamJob::CreateSocketStreamJob( |
| 512 url, &delegate, *context_.get()); | 512 url, &delegate, context_->transport_security_state(), |
| 513 context_->ssl_config_service()); |
| 513 EXPECT_TRUE(GetSocket(job.get())->is_secure()); | 514 EXPECT_TRUE(GetSocket(job.get())->is_secure()); |
| 514 job->DetachDelegate(); | 515 job->DetachDelegate(); |
| 515 | 516 |
| 516 url = GURL("ws://donotupgrademe.com/"); | 517 url = GURL("ws://donotupgrademe.com/"); |
| 517 job = SocketStreamJob::CreateSocketStreamJob( | 518 job = SocketStreamJob::CreateSocketStreamJob( |
| 518 url, &delegate, *context_.get()); | 519 url, &delegate, context_->transport_security_state(), |
| 520 context_->ssl_config_service()); |
| 519 EXPECT_FALSE(GetSocket(job.get())->is_secure()); | 521 EXPECT_FALSE(GetSocket(job.get())->is_secure()); |
| 520 job->DetachDelegate(); | 522 job->DetachDelegate(); |
| 521 } | 523 } |
| 522 | 524 |
| 523 } // namespace net | 525 } // namespace net |
| OLD | NEW |