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

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

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch a few remaining call-sites. Created 8 years, 9 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
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 <iostream> 6 #include <iostream>
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/spdy/spdy_framer.h" 9 #include "net/spdy/spdy_framer.h"
10 #include "net/spdy/spdy_protocol.h" 10 #include "net/spdy/spdy_protocol.h"
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 framer.set_visitor(&visitor); 2603 framer.set_visitor(&visitor);
2604 framer.ProcessInput("HTTP/1.0", 8); 2604 framer.ProcessInput("HTTP/1.0", 8);
2605 EXPECT_TRUE(framer.probable_http_response()); 2605 EXPECT_TRUE(framer.probable_http_response());
2606 } 2606 }
2607 } 2607 }
2608 2608
2609 TEST_P(SpdyFramerTest, SettingsFlagsAndId) { 2609 TEST_P(SpdyFramerTest, SettingsFlagsAndId) {
2610 const uint32 kId = 0x020304; 2610 const uint32 kId = 0x020304;
2611 const uint32 kFlags = 0x01; 2611 const uint32 kFlags = 0x01;
2612 const uint32 kWireFormat = 2612 const uint32 kWireFormat =
2613 htonl(IsSpdy2() ? 0x04030201 : 0x01020304); 2613 base::HostToNet32(IsSpdy2() ? 0x04030201 : 0x01020304);
2614 2614
2615 SettingsFlagsAndId id_and_flags = 2615 SettingsFlagsAndId id_and_flags =
2616 SettingsFlagsAndId::FromWireFormat(spdy_version_, kWireFormat); 2616 SettingsFlagsAndId::FromWireFormat(spdy_version_, kWireFormat);
2617 EXPECT_EQ(kId, id_and_flags.id()); 2617 EXPECT_EQ(kId, id_and_flags.id());
2618 EXPECT_EQ(kFlags, id_and_flags.flags()); 2618 EXPECT_EQ(kFlags, id_and_flags.flags());
2619 EXPECT_EQ(kWireFormat, id_and_flags.GetWireFormat(spdy_version_)); 2619 EXPECT_EQ(kWireFormat, id_and_flags.GetWireFormat(spdy_version_));
2620 } 2620 }
2621 2621
2622 } // namespace 2622 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698