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

Side by Side Diff: ui/app_list/search/tokenized_string_match_unittest.cc

Issue 522683003: Move basic string operations to ui/app_list/search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 6 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/app_list/search/tokenized_string_match.h"
6
5 #include <string> 7 #include <string>
6 8
7 #include "base/basictypes.h" 9 #include "base/basictypes.h"
8 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/app_list/search/tokenized_string_match.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 12
12 namespace app_list { 13 namespace app_list {
13 namespace test { 14 namespace test {
14 15
15 // Returns a string of |text| marked the hits in |match| using block bracket. 16 // Returns a string of |text| marked the hits in |match| using block bracket.
16 // e.g. text= "Text", hits = [{0,1}], returns "[T]ext". 17 // e.g. text= "Text", hits = [{0,1}], returns "[T]ext".
17 std::string MatchHit(const base::string16& text, 18 std::string MatchHit(const base::string16& text,
18 const TokenizedStringMatch& match) { 19 const TokenizedStringMatch& match) {
19 base::string16 marked = text; 20 base::string16 marked = text;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 EXPECT_LT(match_low.relevance(), match_high.relevance()) 114 EXPECT_LT(match_low.relevance(), match_high.relevance())
114 << "Test case " << i 115 << "Test case " << i
115 << " : text=" << kTestCases[i].text 116 << " : text=" << kTestCases[i].text
116 << ", query_low=" << kTestCases[i].query_low 117 << ", query_low=" << kTestCases[i].query_low
117 << ", query_high=" << kTestCases[i].query_high; 118 << ", query_high=" << kTestCases[i].query_high;
118 } 119 }
119 } 120 }
120 121
121 } // namespace test 122 } // namespace test
122 } // namespace app_list 123 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/search/tokenized_string_match.cc ('k') | ui/app_list/search/tokenized_string_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698