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

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

Issue 392883002: fix narrowing conversion warning in SpdyFramerTest.CreatePriority (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 <iostream> 6 #include <iostream>
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 2969 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 } 2980 }
2981 2981
2982 TEST_P(SpdyFramerTest, CreatePriority) { 2982 TEST_P(SpdyFramerTest, CreatePriority) {
2983 if (spdy_version_ <= SPDY3) { 2983 if (spdy_version_ <= SPDY3) {
2984 return; 2984 return;
2985 } 2985 }
2986 2986
2987 SpdyFramer framer(spdy_version_); 2987 SpdyFramer framer(spdy_version_);
2988 2988
2989 const char kDescription[] = "PRIORITY frame"; 2989 const char kDescription[] = "PRIORITY frame";
2990 const char kType = static_cast<unsigned char>( 2990 const unsigned char kType = static_cast<unsigned char>(
2991 SpdyConstants::SerializeFrameType(spdy_version_, PRIORITY)); 2991 SpdyConstants::SerializeFrameType(spdy_version_, PRIORITY));
2992 const unsigned char kFrameData[] = { 2992 const unsigned char kFrameData[] = {
2993 0x00, 0x05, kType, 0x00, 2993 0x00, 0x05, kType, 0x00,
2994 0x00, 0x00, 0x00, 0x02, // Stream ID = 2 2994 0x00, 0x00, 0x00, 0x02, // Stream ID = 2
2995 0x80, 0x00, 0x00, 0x01, // Exclusive dependency, parent stream ID = 1 2995 0x80, 0x00, 0x00, 0x01, // Exclusive dependency, parent stream ID = 1
2996 0x10, // Weight = 16 2996 0x10, // Weight = 16
2997 }; 2997 };
2998 SpdyPriorityIR priority_ir(2, 1, 16, true); 2998 SpdyPriorityIR priority_ir(2, 1, 16, true);
2999 scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(priority_ir)); 2999 scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(priority_ir));
3000 CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData)); 3000 CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData));
(...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after
5362 EXPECT_EQ(4u, framer.MapWeightToPriority(109)); 5362 EXPECT_EQ(4u, framer.MapWeightToPriority(109));
5363 EXPECT_EQ(4u, framer.MapWeightToPriority(74)); 5363 EXPECT_EQ(4u, framer.MapWeightToPriority(74));
5364 EXPECT_EQ(5u, framer.MapWeightToPriority(73)); 5364 EXPECT_EQ(5u, framer.MapWeightToPriority(73));
5365 EXPECT_EQ(5u, framer.MapWeightToPriority(37)); 5365 EXPECT_EQ(5u, framer.MapWeightToPriority(37));
5366 EXPECT_EQ(6u, framer.MapWeightToPriority(36)); 5366 EXPECT_EQ(6u, framer.MapWeightToPriority(36));
5367 EXPECT_EQ(6u, framer.MapWeightToPriority(1)); 5367 EXPECT_EQ(6u, framer.MapWeightToPriority(1));
5368 EXPECT_EQ(7u, framer.MapWeightToPriority(0)); 5368 EXPECT_EQ(7u, framer.MapWeightToPriority(0));
5369 } 5369 }
5370 5370
5371 } // namespace net 5371 } // 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