Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: net/quic/quic_framer_test.cc

Issue 113073003: Enabled StopPacketProcessing unit test. Added EXPECT_CALL for (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <map> 6 #include <map>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after
3445 3445
3446 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); 3446 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
3447 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); 3447 EXPECT_TRUE(framer_.ProcessPacket(encrypted));
3448 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); 3448 EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
3449 ASSERT_TRUE(visitor_.header_.get()); 3449 ASSERT_TRUE(visitor_.header_.get());
3450 EXPECT_TRUE(visitor_.header_->fec_flag); 3450 EXPECT_TRUE(visitor_.header_->fec_flag);
3451 EXPECT_TRUE(visitor_.header_->entropy_flag); 3451 EXPECT_TRUE(visitor_.header_->entropy_flag);
3452 EXPECT_EQ(1 << 4, visitor_.header_->entropy_hash); 3452 EXPECT_EQ(1 << 4, visitor_.header_->entropy_hash);
3453 }; 3453 };
3454 3454
3455 // http://crbug.com/331630. TODO(rtenneti): fix the uninitialized memory issue. 3455 TEST_P(QuicFramerTest, StopPacketProcessing) {
3456 TEST_P(QuicFramerTest, DISABLED_StopPacketProcessing) {
3457 unsigned char packet[] = { 3456 unsigned char packet[] = {
3458 // public flags (8 byte guid) 3457 // public flags (8 byte guid)
3459 0x3C, 3458 0x3C,
3460 // guid 3459 // guid
3461 0x10, 0x32, 0x54, 0x76, 3460 0x10, 0x32, 0x54, 0x76,
3462 0x98, 0xBA, 0xDC, 0xFE, 3461 0x98, 0xBA, 0xDC, 0xFE,
3463 // packet sequence number 3462 // packet sequence number
3464 0xBC, 0x9A, 0x78, 0x56, 3463 0xBC, 0x9A, 0x78, 0x56,
3465 0x34, 0x12, 3464 0x34, 0x12,
3466 // Entropy 3465 // Entropy
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3499 0x34, 0x12, 3498 0x34, 0x12,
3500 }; 3499 };
3501 3500
3502 MockFramerVisitor visitor; 3501 MockFramerVisitor visitor;
3503 framer_.set_visitor(&visitor); 3502 framer_.set_visitor(&visitor);
3504 EXPECT_CALL(visitor, OnPacket()); 3503 EXPECT_CALL(visitor, OnPacket());
3505 EXPECT_CALL(visitor, OnPacketHeader(_)); 3504 EXPECT_CALL(visitor, OnPacketHeader(_));
3506 EXPECT_CALL(visitor, OnStreamFrame(_)).WillOnce(Return(false)); 3505 EXPECT_CALL(visitor, OnStreamFrame(_)).WillOnce(Return(false));
3507 EXPECT_CALL(visitor, OnAckFrame(_)).Times(0); 3506 EXPECT_CALL(visitor, OnAckFrame(_)).Times(0);
3508 EXPECT_CALL(visitor, OnPacketComplete()); 3507 EXPECT_CALL(visitor, OnPacketComplete());
3508 EXPECT_CALL(visitor, OnUnauthenticatedPublicHeader(_)).WillOnce(Return(true));
3509 3509
3510 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false); 3510 QuicEncryptedPacket encrypted(AsChars(packet), arraysize(packet), false);
3511 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); 3511 EXPECT_TRUE(framer_.ProcessPacket(encrypted));
3512 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); 3512 EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
3513 } 3513 }
3514 3514
3515 } // namespace test 3515 } // namespace test
3516 } // namespace net 3516 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698