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

Side by Side Diff: components/packed_ct_ev_whitelist/bit_stream_reader_unittest.cc

Issue 811353002: Move CT EV white list packaging API from chrome/ to components/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed missed nit Created 5 years, 11 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
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 "chrome/browser/net/bit_stream_reader.h" 5 #include "components/packed_ct_ev_whitelist/bit_stream_reader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace packed_ct_ev_whitelist {
12 namespace internal { 13 namespace internal {
13 14
14 const uint8_t kSomeData[] = {0xd5, 0xe2, 0xaf, 0xe5, 0xbb, 0x10, 0x7c, 0xd1}; 15 const uint8_t kSomeData[] = {0xd5, 0xe2, 0xaf, 0xe5, 0xbb, 0x10, 0x7c, 0xd1};
15 16
16 TEST(BitStreamReaderTest, CanReadSingleByte) { 17 TEST(BitStreamReaderTest, CanReadSingleByte) {
17 BitStreamReader reader( 18 BitStreamReader reader(
18 base::StringPiece(reinterpret_cast<const char*>(kSomeData), 1)); 19 base::StringPiece(reinterpret_cast<const char*>(kSomeData), 1));
19 uint64_t v(0); 20 uint64_t v(0);
20 21
21 EXPECT_EQ(8u, reader.BitsLeft()); 22 EXPECT_EQ(8u, reader.BitsLeft());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 BitStreamReader reader(base::StringPiece( 87 BitStreamReader reader(base::StringPiece(
87 reinterpret_cast<const char*>(kSomeData), static_cast<size_t>(0u))); 88 reinterpret_cast<const char*>(kSomeData), static_cast<size_t>(0u)));
88 uint64_t v(0); 89 uint64_t v(0);
89 90
90 EXPECT_EQ(0u, reader.BitsLeft()); 91 EXPECT_EQ(0u, reader.BitsLeft());
91 EXPECT_FALSE(reader.ReadBits(1, &v)); 92 EXPECT_FALSE(reader.ReadBits(1, &v));
92 EXPECT_FALSE(reader.ReadUnaryEncoding(&v)); 93 EXPECT_FALSE(reader.ReadUnaryEncoding(&v));
93 } 94 }
94 95
95 } // namespace internal 96 } // namespace internal
97 } // namespace packed_ct_ev_whitelist
OLDNEW
« no previous file with comments | « components/packed_ct_ev_whitelist/bit_stream_reader.cc ('k') | components/packed_ct_ev_whitelist/packed_ct_ev_whitelist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698