| 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_protocol.h" | 5 #include "net/spdy/spdy_protocol.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/spdy/spdy_bitmasks.h" | 8 #include "net/spdy/spdy_bitmasks.h" |
| 9 #include "net/spdy/spdy_framer.h" | 9 #include "net/spdy/spdy_framer.h" |
| 10 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 settings[id] = SettingsFlagsAndValue(flags, index); | 238 settings[id] = SettingsFlagsAndValue(flags, index); |
| 239 settings_frame.reset(framer.CreateSettings(settings)); | 239 settings_frame.reset(framer.CreateSettings(settings)); |
| 240 EXPECT_EQ(framer.protocol_version(), settings_frame->version()); | 240 EXPECT_EQ(framer.protocol_version(), settings_frame->version()); |
| 241 EXPECT_TRUE(settings_frame->is_control_frame()); | 241 EXPECT_TRUE(settings_frame->is_control_frame()); |
| 242 EXPECT_EQ(SETTINGS, settings_frame->type()); | 242 EXPECT_EQ(SETTINGS, settings_frame->type()); |
| 243 EXPECT_EQ(index + 1, settings_frame->num_entries()); | 243 EXPECT_EQ(index + 1, settings_frame->num_entries()); |
| 244 | 244 |
| 245 SettingsMap parsed_settings; | 245 SettingsMap parsed_settings; |
| 246 EXPECT_TRUE(framer.ParseSettings(settings_frame.get(), &parsed_settings)); | 246 EXPECT_TRUE(framer.ParseSettings(settings_frame.get(), &parsed_settings)); |
| 247 EXPECT_EQ(settings.size(), parsed_settings.size()); | 247 EXPECT_EQ(settings.size(), parsed_settings.size()); |
| 248 SettingsMap::const_iterator it, it2; | 248 for (SettingsMap::const_iterator it = parsed_settings.begin(); |
| 249 for (it = parsed_settings.begin(); it != parsed_settings.end(); it++) { | 249 it != parsed_settings.end(); |
| 250 it2 = settings.find(it->first); | 250 it++) { |
| 251 SettingsMap::const_iterator it2 = settings.find(it->first); |
| 251 EXPECT_EQ(it->first, it2->first); | 252 EXPECT_EQ(it->first, it2->first); |
| 252 SettingsFlagsAndValue parsed = it->second; | 253 SettingsFlagsAndValue parsed = it->second; |
| 253 SettingsFlagsAndValue created = it2->second; | 254 SettingsFlagsAndValue created = it2->second; |
| 254 EXPECT_EQ(created.first, parsed.first); | 255 EXPECT_EQ(created.first, parsed.first); |
| 255 EXPECT_EQ(created.second, parsed.second); | 256 EXPECT_EQ(created.second, parsed.second); |
| 256 } | 257 } |
| 257 } | 258 } |
| 258 } | 259 } |
| 259 | 260 |
| 260 TEST_P(SpdyProtocolTest, HasHeaderBlock) { | 261 TEST_P(SpdyProtocolTest, HasHeaderBlock) { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 380 |
| 380 rst_frame->set_status( | 381 rst_frame->set_status( |
| 381 static_cast<SpdyStatusCodes>(INVALID - 1)); | 382 static_cast<SpdyStatusCodes>(INVALID - 1)); |
| 382 EXPECT_EQ(INVALID, rst_frame->status()); | 383 EXPECT_EQ(INVALID, rst_frame->status()); |
| 383 | 384 |
| 384 rst_frame->set_status(NUM_STATUS_CODES); | 385 rst_frame->set_status(NUM_STATUS_CODES); |
| 385 EXPECT_EQ(INVALID, rst_frame->status()); | 386 EXPECT_EQ(INVALID, rst_frame->status()); |
| 386 } | 387 } |
| 387 | 388 |
| 388 } // namespace net | 389 } // namespace net |
| OLD | NEW |