| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/logging.h" | |
| 6 #include "base/sha2.h" | 5 #include "base/sha2.h" |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 6 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 8 #include "googleurl/src/gurl.h" | 7 #include "googleurl/src/gurl.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 9 |
| 11 namespace { | 10 namespace { |
| 12 bool VectorContains(const std::vector<std::string>& data, | 11 bool VectorContains(const std::vector<std::string>& data, |
| 13 const std::string& str) { | 12 const std::string& str) { |
| 14 for (size_t i = 0; i < data.size(); ++i) { | 13 for (size_t i = 0; i < data.size(); ++i) { |
| 15 if (data[i] == str) | 14 if (data[i] == str) |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Now add the prefix. | 285 // Now add the prefix. |
| 287 entry = SBEntry::Create(SBEntry::ADD_PREFIX, 1); | 286 entry = SBEntry::Create(SBEntry::ADD_PREFIX, 1); |
| 288 entry->SetPrefixAt(0, 0x01000000); | 287 entry->SetPrefixAt(0, 0x01000000); |
| 289 entry->set_list_id(1); | 288 entry->set_list_id(1); |
| 290 entry->set_chunk_id(1); | 289 entry->set_chunk_id(1); |
| 291 info.AddPrefixes(entry); | 290 info.AddPrefixes(entry); |
| 292 entry->Destroy(); | 291 entry->Destroy(); |
| 293 | 292 |
| 294 EXPECT_FALSE(info.Contains(full_hashes, &list_id, &prefix_hits)); | 293 EXPECT_FALSE(info.Contains(full_hashes, &list_id, &prefix_hits)); |
| 295 } | 294 } |
| OLD | NEW |