OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "chrome/browser/safe_browsing/protocol_parser.h" | 12 #include "chrome/browser/safe_browsing/protocol_parser.h" |
13 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | |
14 #include "components/safe_browsing_db/metadata.pb.h" | 13 #include "components/safe_browsing_db/metadata.pb.h" |
| 14 #include "components/safe_browsing_db/util.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace safe_browsing { | 17 namespace safe_browsing { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char kDefaultPhishList[] = "goog-phish-shavar"; | 21 const char kDefaultPhishList[] = "goog-phish-shavar"; |
22 const char kDefaultMalwareList[] = "goog-malware-shavar"; | 22 const char kDefaultMalwareList[] = "goog-malware-shavar"; |
23 | 23 |
24 } // namespace | 24 } // namespace |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 EXPECT_FALSE(chunks[0]->IsAdd()); | 717 EXPECT_FALSE(chunks[0]->IsAdd()); |
718 EXPECT_TRUE(chunks[0]->IsSub()); | 718 EXPECT_TRUE(chunks[0]->IsSub()); |
719 EXPECT_TRUE(chunks[2]->IsPrefix()); | 719 EXPECT_TRUE(chunks[2]->IsPrefix()); |
720 EXPECT_FALSE(chunks[2]->IsFullHash()); | 720 EXPECT_FALSE(chunks[2]->IsFullHash()); |
721 ASSERT_EQ(1U, chunks[2]->PrefixCount()); | 721 ASSERT_EQ(1U, chunks[2]->PrefixCount()); |
722 EXPECT_EQ(0x70707070U, chunks[2]->PrefixAt(0)); // pppp | 722 EXPECT_EQ(0x70707070U, chunks[2]->PrefixAt(0)); // pppp |
723 EXPECT_EQ(11, chunks[2]->AddChunkNumberAt(0)); | 723 EXPECT_EQ(11, chunks[2]->AddChunkNumberAt(0)); |
724 } | 724 } |
725 | 725 |
726 } // namespace safe_browsing | 726 } // namespace safe_browsing |
OLD | NEW |