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/url_request/view_cache_helper.h"
6 
7 #include <cstring>
8 
9 #include "testing/gtest/include/gtest/gtest.h"
10 
11 namespace net {
12 
TEST(ViewCacheHelper,HexDump)13 TEST(ViewCacheHelper, HexDump) {
14   std::string out = "Prefix\n";
15   const char kIn[] = "0123456789ABCDEFGHIJ\x01\x80<&>";
16   ViewCacheHelper::HexDump(kIn, strlen(kIn), &out);
17   EXPECT_EQ(
18       "Prefix\n00000000: 30 31 32 33 34 35 36 37 38 39 41 42 43 44 45 46  "
19       "0123456789ABCDEF\n00000010: 47 48 49 4a 01 80 3c 26 3e                  "
20       "     GHIJ..&lt;&amp;&gt;\n",
21       out);
22 }
23 
24 }  // namespace net
25