| 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 "chrome/browser/history/query_parser.h" | 5 #include "chrome/browser/history/query_parser.h" |
| 6 #include "base/logging.h" | 6 #include "base/basictypes.h" |
| 7 #include "chrome/common/scoped_vector.h" | 7 #include "chrome/common/scoped_vector.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 class QueryParserTest : public testing::Test { | 10 class QueryParserTest : public testing::Test { |
| 11 public: | 11 public: |
| 12 struct TestData { | 12 struct TestData { |
| 13 const std::wstring input; | 13 const std::wstring input; |
| 14 const int expected_word_count; | 14 const int expected_word_count; |
| 15 }; | 15 }; |
| 16 | 16 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 QueryParser parser; | 150 QueryParser parser; |
| 151 parser.ExtractQueryWords(data[i].text, &results); | 151 parser.ExtractQueryWords(data[i].text, &results); |
| 152 ASSERT_EQ(data[i].word_count, results.size()); | 152 ASSERT_EQ(data[i].word_count, results.size()); |
| 153 EXPECT_EQ(data[i].w1, results[0]); | 153 EXPECT_EQ(data[i].w1, results[0]); |
| 154 if (results.size() == 2) | 154 if (results.size() == 2) |
| 155 EXPECT_EQ(data[i].w2, results[1]); | 155 EXPECT_EQ(data[i].w2, results[1]); |
| 156 if (results.size() == 3) | 156 if (results.size() == 3) |
| 157 EXPECT_EQ(data[i].w3, results[2]); | 157 EXPECT_EQ(data[i].w3, results[2]); |
| 158 } | 158 } |
| 159 } | 159 } |
| OLD | NEW |