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

Side by Side Diff: components/compression/compression_utils_unittest.cc

Issue 1304563003: Move //components/metrics/compression_utils into standalone component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « components/compression/compression_utils.cc ('k') | components/metrics.gypi » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/metrics/compression_utils.h" 5 #include "components/compression/compression_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace metrics { 13 namespace compression {
14 14
15 namespace { 15 namespace {
16 16
17 // The data to be compressed by gzip. This is the hex representation of "hello 17 // The data to be compressed by gzip. This is the hex representation of "hello
18 // world". 18 // world".
19 const uint8 kData[] = 19 const uint8 kData[] =
20 {0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 20 {0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f,
21 0x72, 0x6c, 0x64}; 21 0x72, 0x6c, 0x64};
22 22
23 // This is the string representation of gzip compressed string above. It was 23 // This is the string representation of gzip compressed string above. It was
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 reinterpret_cast<const char*>(kCompressedData), 80 reinterpret_cast<const char*>(kCompressedData),
81 arraysize(kCompressedData)); 81 arraysize(kCompressedData));
82 82
83 std::string data(original_data); 83 std::string data(original_data);
84 EXPECT_TRUE(GzipCompress(data, &data)); 84 EXPECT_TRUE(GzipCompress(data, &data));
85 EXPECT_EQ(golden_compressed_data, data); 85 EXPECT_EQ(golden_compressed_data, data);
86 EXPECT_TRUE(GzipUncompress(data, &data)); 86 EXPECT_TRUE(GzipUncompress(data, &data));
87 EXPECT_EQ(original_data, data); 87 EXPECT_EQ(original_data, data);
88 } 88 }
89 89
90 } // namespace metrics 90 } // namespace compression
OLDNEW
« no previous file with comments | « components/compression/compression_utils.cc ('k') | components/metrics.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698