| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/autocomplete/autocomplete_match.h" | 8 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 9 #include "chrome/browser/autocomplete/keyword_provider.h" | 9 #include "chrome/browser/autocomplete/keyword_provider.h" |
| 10 #include "chrome/browser/search_engines/template_url.h" | 10 #include "chrome/browser/search_engines/template_url.h" |
| 11 #include "chrome/browser/search_engines/template_url_service.h" | 11 #include "chrome/browser/search_engines/template_url_service.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/test/base/testing_browser_process.h" | 13 #include "chrome/test/base/testing_browser_process.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 using base::ASCIIToUTF16; |
| 18 |
| 17 class KeywordProviderTest : public testing::Test { | 19 class KeywordProviderTest : public testing::Test { |
| 18 protected: | 20 protected: |
| 19 template<class ResultType> | 21 template<class ResultType> |
| 20 struct MatchType { | 22 struct MatchType { |
| 21 const ResultType member; | 23 const ResultType member; |
| 22 bool allowed_to_be_default_match; | 24 bool allowed_to_be_default_match; |
| 23 }; | 25 }; |
| 24 | 26 |
| 25 template<class ResultType> | 27 template<class ResultType> |
| 26 struct TestData { | 28 struct TestData { |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 TestData<GURL> url_cases[] = { | 347 TestData<GURL> url_cases[] = { |
| 346 { ASCIIToUTF16("a 1 2 3"), 3, | 348 { ASCIIToUTF16("a 1 2 3"), 3, |
| 347 { { GURL("aa.com?a=b&foo=1+2+3"), false }, | 349 { { GURL("aa.com?a=b&foo=1+2+3"), false }, |
| 348 { GURL("bogus URL 1+2+3"), false }, | 350 { GURL("bogus URL 1+2+3"), false }, |
| 349 { GURL("http://aaaa/?aaaa=1&b=1+2+3&c"), false } } }, | 351 { GURL("http://aaaa/?aaaa=1&b=1+2+3&c"), false } } }, |
| 350 }; | 352 }; |
| 351 | 353 |
| 352 RunTest<GURL>(url_cases, arraysize(url_cases), | 354 RunTest<GURL>(url_cases, arraysize(url_cases), |
| 353 &AutocompleteMatch::destination_url); | 355 &AutocompleteMatch::destination_url); |
| 354 } | 356 } |
| OLD | NEW |