| 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "chrome/browser/autocomplete/keyword_provider.h" | 6 #include "chrome/browser/autocomplete/keyword_provider.h" |
| 7 #include "chrome/browser/template_url.h" | 7 #include "chrome/browser/search_engines/template_url.h" |
| 8 #include "chrome/browser/template_url_model.h" | 8 #include "chrome/browser/search_engines/template_url_model.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 class KeywordProviderTest : public testing::Test { | 12 class KeywordProviderTest : public testing::Test { |
| 13 protected: | 13 protected: |
| 14 template<class ResultType> | 14 template<class ResultType> |
| 15 struct test_data { | 15 struct test_data { |
| 16 const std::wstring input; | 16 const std::wstring input; |
| 17 const size_t num_results; | 17 const size_t num_results; |
| 18 const ResultType output[3]; | 18 const ResultType output[3]; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 model_->Add(template_url); | 186 model_->Add(template_url); |
| 187 ASSERT_TRUE(template_url == model_->GetTemplateURLForKeyword(keyword)); | 187 ASSERT_TRUE(template_url == model_->GetTemplateURLForKeyword(keyword)); |
| 188 } | 188 } |
| 189 | 189 |
| 190 TEST_F(KeywordProviderTest, RemoveKeyword) { | 190 TEST_F(KeywordProviderTest, RemoveKeyword) { |
| 191 std::wstring url(L"http://aaaa/?aaaa=1&b={searchTerms}&c"); | 191 std::wstring url(L"http://aaaa/?aaaa=1&b={searchTerms}&c"); |
| 192 model_->Remove(model_->GetTemplateURLForKeyword(L"aaaa")); | 192 model_->Remove(model_->GetTemplateURLForKeyword(L"aaaa")); |
| 193 ASSERT_TRUE(model_->GetTemplateURLForKeyword(L"aaaa") == NULL); | 193 ASSERT_TRUE(model_->GetTemplateURLForKeyword(L"aaaa") == NULL); |
| 194 } | 194 } |
| 195 | 195 |
| OLD | NEW |