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

Side by Side Diff: net/http/http_util_unittest.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/http/http_util.cc ('k') | net/http/http_version.h » ('j') | 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 6
7 #include "base/basictypes.h"
8 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
9 #include "net/http/http_util.h" 8 #include "net/http/http_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
11 10
12 namespace net { 11 namespace net {
13 12
14 namespace { 13 namespace {
15 class HttpUtilTest : public testing::Test {}; 14 class HttpUtilTest : public testing::Test {};
16 } 15 }
17 16
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 EXPECT_EQ(tests[i].expected_boundary, boundary) << "i=" << i; 758 EXPECT_EQ(tests[i].expected_boundary, boundary) << "i=" << i;
760 } 759 }
761 } 760 }
762 761
763 TEST(HttpUtilTest, ParseRanges) { 762 TEST(HttpUtilTest, ParseRanges) {
764 const struct { 763 const struct {
765 const char* const headers; 764 const char* const headers;
766 bool expected_return_value; 765 bool expected_return_value;
767 size_t expected_ranges_size; 766 size_t expected_ranges_size;
768 const struct { 767 const struct {
769 int64 expected_first_byte_position; 768 int64_t expected_first_byte_position;
770 int64 expected_last_byte_position; 769 int64_t expected_last_byte_position;
771 int64 expected_suffix_length; 770 int64_t expected_suffix_length;
772 } expected_ranges[10]; 771 } expected_ranges[10];
773 } tests[] = { 772 } tests[] = {
774 { "Range: bytes=0-10", 773 { "Range: bytes=0-10",
775 true, 774 true,
776 1, 775 1,
777 { {0, 10, -1}, } 776 { {0, 10, -1}, }
778 }, 777 },
779 { "Range: bytes=10-0", 778 { "Range: bytes=10-0",
780 false, 779 false,
781 0, 780 0,
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 HttpUtil::NameValuePairsIterator parser(data.begin(), data.end(), ';'); 1171 HttpUtil::NameValuePairsIterator parser(data.begin(), data.end(), ';');
1173 EXPECT_TRUE(parser.valid()); 1172 EXPECT_TRUE(parser.valid());
1174 1173
1175 ASSERT_NO_FATAL_FAILURE( 1174 ASSERT_NO_FATAL_FAILURE(
1176 CheckNextNameValuePair(&parser, true, true, "name", "value")); 1175 CheckNextNameValuePair(&parser, true, true, "name", "value"));
1177 ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair( 1176 ASSERT_NO_FATAL_FAILURE(CheckNextNameValuePair(
1178 &parser, false, true, std::string(), std::string())); 1177 &parser, false, true, std::string(), std::string()));
1179 } 1178 }
1180 1179
1181 } // namespace net 1180 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_util.cc ('k') | net/http/http_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698