| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |