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

Side by Side Diff: chrome/browser/history/snippet_unittest.cc

Issue 12378016: chrome: Update include paths of string_split.h to its new location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « chrome/browser/history/snippet.cc ('k') | chrome/browser/history/top_sites_database.cc » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/history/snippet.h" 5 #include "chrome/browser/history/snippet.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_split.h"
10 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/strings/string_split.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace { 14 namespace {
15 15
16 // A sample document to compute snippets of. 16 // A sample document to compute snippets of.
17 // The \x bits after the first "Google" are UTF-8 of U+2122 TRADE MARK SIGN, 17 // The \x bits after the first "Google" are UTF-8 of U+2122 TRADE MARK SIGN,
18 // and are useful for verifying we don't screw up in UTF-8/UTF-16 conversion. 18 // and are useful for verifying we don't screw up in UTF-8/UTF-16 conversion.
19 const char* kSampleDocument = "Google\xe2\x84\xa2 Terms of Service " 19 const char* kSampleDocument = "Google\xe2\x84\xa2 Terms of Service "
20 "Welcome to Google! " 20 "Welcome to Google! "
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) { 243 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
244 Snippet::MatchPositions matches; 244 Snippet::MatchPositions matches;
245 Snippet::ExtractMatchPositions(data[i].offsets_string, "0", &matches); 245 Snippet::ExtractMatchPositions(data[i].offsets_string, "0", &matches);
246 EXPECT_EQ(data[i].expected_match_count, matches.size()); 246 EXPECT_EQ(data[i].expected_match_count, matches.size());
247 for (size_t j = 0; j < data[i].expected_match_count; ++j) { 247 for (size_t j = 0; j < data[i].expected_match_count; ++j) {
248 EXPECT_EQ(data[i].expected_matches[2 * j], matches[j].first); 248 EXPECT_EQ(data[i].expected_matches[2 * j], matches[j].first);
249 EXPECT_EQ(data[i].expected_matches[2 * j + 1], matches[j].second); 249 EXPECT_EQ(data[i].expected_matches[2 * j + 1], matches[j].second);
250 } 250 }
251 } 251 }
252 } 252 }
OLDNEW
« no previous file with comments | « chrome/browser/history/snippet.cc ('k') | chrome/browser/history/top_sites_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698