spdy_http_utils_unittest.cc revision 5821806d5e7f356e8fa4b058a389a808ea183019
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
3// found in the LICENSE file.
4
5#include "net/spdy/spdy_http_utils.h"
6
7#include "testing/platform_test.h"
8
9namespace net {
10
11namespace test {
12
13TEST(SpdyHttpUtilsTest, ConvertRequestPriorityToSpdy2Priority) {
14  EXPECT_EQ(0, ConvertRequestPriorityToSpdyPriority(HIGHEST, 2));
15  EXPECT_EQ(1, ConvertRequestPriorityToSpdyPriority(MEDIUM, 2));
16  EXPECT_EQ(2, ConvertRequestPriorityToSpdyPriority(LOW, 2));
17  EXPECT_EQ(2, ConvertRequestPriorityToSpdyPriority(LOWEST, 2));
18  EXPECT_EQ(3, ConvertRequestPriorityToSpdyPriority(IDLE, 2));
19}
20TEST(SpdyHttpUtilsTest, ConvertRequestPriorityToSpdy3Priority) {
21  EXPECT_EQ(0, ConvertRequestPriorityToSpdyPriority(HIGHEST, 3));
22  EXPECT_EQ(1, ConvertRequestPriorityToSpdyPriority(MEDIUM, 3));
23  EXPECT_EQ(2, ConvertRequestPriorityToSpdyPriority(LOW, 3));
24  EXPECT_EQ(3, ConvertRequestPriorityToSpdyPriority(LOWEST, 3));
25  EXPECT_EQ(4, ConvertRequestPriorityToSpdyPriority(IDLE, 3));
26}
27
28}  // namespace test
29
30}  // namespace net
31