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

Side by Side Diff: net/spdy/spdy_protocol_test.cc

Issue 288373004: Add handling + parsing for HTTP/2 ALTSVC frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Non-static initializer fixes. Created 6 years, 7 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 | « net/spdy/spdy_protocol.cc ('k') | 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 "net/spdy/spdy_protocol.h" 5 #include "net/spdy/spdy_protocol.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 EXPECT_EQ(4, SETTINGS); 48 EXPECT_EQ(4, SETTINGS);
49 EXPECT_EQ(5, NOOP); 49 EXPECT_EQ(5, NOOP);
50 EXPECT_EQ(6, PING); 50 EXPECT_EQ(6, PING);
51 EXPECT_EQ(7, GOAWAY); 51 EXPECT_EQ(7, GOAWAY);
52 EXPECT_EQ(8, HEADERS); 52 EXPECT_EQ(8, HEADERS);
53 EXPECT_EQ(9, WINDOW_UPDATE); 53 EXPECT_EQ(9, WINDOW_UPDATE);
54 EXPECT_EQ(10, CREDENTIAL); 54 EXPECT_EQ(10, CREDENTIAL);
55 EXPECT_EQ(11, BLOCKED); 55 EXPECT_EQ(11, BLOCKED);
56 EXPECT_EQ(12, PUSH_PROMISE); 56 EXPECT_EQ(12, PUSH_PROMISE);
57 EXPECT_EQ(13, CONTINUATION); 57 EXPECT_EQ(13, CONTINUATION);
58 EXPECT_EQ(13, LAST_CONTROL_TYPE); 58 EXPECT_EQ(14, ALTSVC);
59 EXPECT_EQ(14, LAST_CONTROL_TYPE);
59 EXPECT_EQ(std::numeric_limits<int32>::max(), kSpdyMaximumWindowSize); 60 EXPECT_EQ(std::numeric_limits<int32>::max(), kSpdyMaximumWindowSize);
60 } 61 }
61 62
62 class SpdyProtocolDeathTest : public SpdyProtocolTest {}; 63 class SpdyProtocolDeathTest : public SpdyProtocolTest {};
63 64
64 // All tests are run with two different SPDY versions: SPDY/2 and SPDY/3. 65 // All tests are run with two different SPDY versions: SPDY/2 and SPDY/3.
65 INSTANTIATE_TEST_CASE_P(SpdyProtocolDeathTests, 66 INSTANTIATE_TEST_CASE_P(SpdyProtocolDeathTests,
66 SpdyProtocolDeathTest, 67 SpdyProtocolDeathTest,
67 ::testing::Values(SPDY2, SPDY3)); 68 ::testing::Values(SPDY2, SPDY3));
68 69
69 TEST_P(SpdyProtocolDeathTest, TestSpdySettingsAndIdOutOfBounds) { 70 TEST_P(SpdyProtocolDeathTest, TestSpdySettingsAndIdOutOfBounds) {
70 scoped_ptr<SettingsFlagsAndId> flags_and_id; 71 scoped_ptr<SettingsFlagsAndId> flags_and_id;
71 72
72 EXPECT_DFATAL(flags_and_id.reset(new SettingsFlagsAndId(1, ~0)), 73 EXPECT_DFATAL(flags_and_id.reset(new SettingsFlagsAndId(1, ~0)),
73 "SPDY setting ID too large."); 74 "SPDY setting ID too large.");
74 // Make sure that we get expected values in opt mode. 75 // Make sure that we get expected values in opt mode.
75 if (flags_and_id.get() != NULL) { 76 if (flags_and_id.get() != NULL) {
76 EXPECT_EQ(1, flags_and_id->flags()); 77 EXPECT_EQ(1, flags_and_id->flags());
77 EXPECT_EQ(static_cast<SpdyPingId>(0xffffff), flags_and_id->id()); 78 EXPECT_EQ(static_cast<SpdyPingId>(0xffffff), flags_and_id->id());
78 } 79 }
79 } 80 }
80 81
81 } // namespace net 82 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_protocol.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698