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

Side by Side Diff: chrome/browser/safe_browsing/protocol_parser_unittest.cc

Issue 15906011: Use a direct include of strings headers in chrome/browser/r*-s*/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
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 // Program to test the SafeBrowsing protocol parsing v2.1. 5 // Program to test the SafeBrowsing protocol parsing v2.1.
6 6
7 #include "base/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/safe_browsing/protocol_parser.h" 8 #include "chrome/browser/safe_browsing/protocol_parser.h"
9 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 9 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 // Test parsing one add chunk. 12 // Test parsing one add chunk.
13 TEST(SafeBrowsingProtocolParsingTest, TestAddChunk) { 13 TEST(SafeBrowsingProtocolParsingTest, TestAddChunk) {
14 std::string add_chunk("a:1:4:35\naaaax1111\0032222333344447777\00288889999"); 14 std::string add_chunk("a:1:4:35\naaaax1111\0032222333344447777\00288889999");
15 add_chunk[13] = '\0'; 15 add_chunk[13] = '\0';
16 16
17 // Run the parse. 17 // Run the parse.
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 EXPECT_EQ(chunks[0].hosts[0].host, 0); 775 EXPECT_EQ(chunks[0].hosts[0].host, 0);
776 SBEntry* entry = chunks[0].hosts[0].entry; 776 SBEntry* entry = chunks[0].hosts[0].entry;
777 EXPECT_TRUE(entry->IsSub()); 777 EXPECT_TRUE(entry->IsSub());
778 ASSERT_FALSE(entry->IsPrefix()); 778 ASSERT_FALSE(entry->IsPrefix());
779 ASSERT_EQ(entry->prefix_count(), 1); 779 ASSERT_EQ(entry->prefix_count(), 1);
780 EXPECT_EQ(entry->ChunkIdAtPrefix(0), 0x31313131); 780 EXPECT_EQ(entry->ChunkIdAtPrefix(0), 0x31313131);
781 SBFullHash full; 781 SBFullHash full;
782 memcpy(full.full_hash, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 32); 782 memcpy(full.full_hash, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 32);
783 EXPECT_TRUE(entry->FullHashAt(0) == full); 783 EXPECT_TRUE(entry->FullHashAt(0) == full);
784 } 784 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/protocol_parser.cc ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698