OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include <ostream> | 5 #include <ostream> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "crypto/secure_hash.h" | 10 #include "crypto/secure_hash.h" |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 scfg->MarkDirty(); | 627 scfg->MarkDirty(); |
628 const QuicData& serialized(scfg->GetSerialized()); | 628 const QuicData& serialized(scfg->GetSerialized()); |
629 | 629 |
630 scoped_ptr<crypto::SecureHash> hash( | 630 scoped_ptr<crypto::SecureHash> hash( |
631 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); | 631 crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
632 hash->Update(serialized.data(), serialized.length()); | 632 hash->Update(serialized.data(), serialized.length()); |
633 uint8 digest[16]; | 633 uint8 digest[16]; |
634 hash->Finish(digest, sizeof(digest)); | 634 hash->Finish(digest, sizeof(digest)); |
635 | 635 |
636 ASSERT_EQ(scid.size(), sizeof(digest)); | 636 ASSERT_EQ(scid.size(), sizeof(digest)); |
637 EXPECT_TRUE(0 == memcmp(digest, scid_str.data(), sizeof(digest))); | 637 EXPECT_EQ(0, memcmp(digest, scid_str.data(), sizeof(digest))); |
638 } | 638 } |
639 | 639 |
640 class CryptoServerTestNoConfig : public CryptoServerTest { | 640 class CryptoServerTestNoConfig : public CryptoServerTest { |
641 public: | 641 public: |
642 virtual void SetUp() { | 642 virtual void SetUp() { |
643 // Deliberately don't add a config so that we can test this situation. | 643 // Deliberately don't add a config so that we can test this situation. |
644 } | 644 } |
645 }; | 645 }; |
646 | 646 |
647 TEST_P(CryptoServerTestNoConfig, DontCrash) { | 647 TEST_P(CryptoServerTestNoConfig, DontCrash) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 | 717 |
718 strike_register_client_->RunPendingVerifications(); | 718 strike_register_client_->RunPendingVerifications(); |
719 ASSERT_TRUE(called); | 719 ASSERT_TRUE(called); |
720 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); | 720 EXPECT_EQ(0, strike_register_client_->PendingVerifications()); |
721 // The message should be rejected now. | 721 // The message should be rejected now. |
722 EXPECT_EQ(kREJ, out_.tag()); | 722 EXPECT_EQ(kREJ, out_.tag()); |
723 } | 723 } |
724 | 724 |
725 } // namespace test | 725 } // namespace test |
726 } // namespace net | 726 } // namespace net |
OLD | NEW |