| 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 "chrome/browser/autocomplete/history_quick_provider.h" |    5 #include "chrome/browser/autocomplete/history_quick_provider.h" | 
|    6  |    6  | 
|    7 #include <algorithm> |    7 #include <algorithm> | 
|    8 #include <functional> |    8 #include <functional> | 
|    9 #include <set> |    9 #include <set> | 
|   10 #include <string> |   10 #include <string> | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
|   22 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |   22 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 
|   23 #include "chrome/browser/autocomplete/history_url_provider.h" |   23 #include "chrome/browser/autocomplete/history_url_provider.h" | 
|   24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |   24 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 
|   25 #include "chrome/browser/chrome_notification_types.h" |   25 #include "chrome/browser/chrome_notification_types.h" | 
|   26 #include "chrome/browser/history/history_backend.h" |   26 #include "chrome/browser/history/history_backend.h" | 
|   27 #include "chrome/browser/history/history_database.h" |   27 #include "chrome/browser/history/history_database.h" | 
|   28 #include "chrome/browser/history/history_service.h" |   28 #include "chrome/browser/history/history_service.h" | 
|   29 #include "chrome/browser/history/history_service_factory.h" |   29 #include "chrome/browser/history/history_service_factory.h" | 
|   30 #include "chrome/browser/history/in_memory_url_index.h" |   30 #include "chrome/browser/history/in_memory_url_index.h" | 
|   31 #include "chrome/browser/history/url_index_private_data.h" |   31 #include "chrome/browser/history/url_index_private_data.h" | 
 |   32 #include "chrome/browser/search_engines/keyword_history_service.h" | 
|   32 #include "chrome/browser/search_engines/template_url_service.h" |   33 #include "chrome/browser/search_engines/template_url_service.h" | 
|   33 #include "chrome/browser/search_engines/template_url_service_factory.h" |   34 #include "chrome/browser/search_engines/template_url_service_factory.h" | 
|   34 #include "chrome/common/pref_names.h" |   35 #include "chrome/common/pref_names.h" | 
|   35 #include "chrome/test/base/testing_browser_process.h" |   36 #include "chrome/test/base/testing_browser_process.h" | 
|   36 #include "chrome/test/base/testing_profile.h" |   37 #include "chrome/test/base/testing_profile.h" | 
|   37 #include "components/bookmarks/test/bookmark_test_helpers.h" |   38 #include "components/bookmarks/test/bookmark_test_helpers.h" | 
|   38 #include "components/history/core/browser/url_database.h" |   39 #include "components/history/core/browser/url_database.h" | 
|   39 #include "components/metrics/proto/omnibox_event.pb.h" |   40 #include "components/metrics/proto/omnibox_event.pb.h" | 
 |   41 #include "components/search_engines/search_terms_data.h" | 
|   40 #include "components/search_engines/template_url.h" |   42 #include "components/search_engines/template_url.h" | 
|   41 #include "content/public/browser/notification_service.h" |   43 #include "content/public/browser/notification_service.h" | 
|   42 #include "content/public/test/test_browser_thread.h" |   44 #include "content/public/test/test_browser_thread.h" | 
|   43 #include "content/public/test/test_utils.h" |   45 #include "content/public/test/test_utils.h" | 
|   44 #include "sql/transaction.h" |   46 #include "sql/transaction.h" | 
|   45 #include "testing/gtest/include/gtest/gtest.h" |   47 #include "testing/gtest/include/gtest/gtest.h" | 
|   46  |   48  | 
|   47 using base::ASCIIToUTF16; |   49 using base::ASCIIToUTF16; | 
|   48 using base::Time; |   50 using base::Time; | 
|   49 using base::TimeDelta; |   51 using base::TimeDelta; | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  122  |  124  | 
|  123     void operator()(const std::string& expected); |  125     void operator()(const std::string& expected); | 
|  124  |  126  | 
|  125     std::set<std::string> LeftOvers() const { return matches_; } |  127     std::set<std::string> LeftOvers() const { return matches_; } | 
|  126  |  128  | 
|  127    private: |  129    private: | 
|  128     std::set<std::string> matches_; |  130     std::set<std::string> matches_; | 
|  129   }; |  131   }; | 
|  130  |  132  | 
|  131   static KeyedService* CreateTemplateURLService( |  133   static KeyedService* CreateTemplateURLService( | 
|  132       content::BrowserContext* profile) { |  134       content::BrowserContext* context) { | 
|  133     return new TemplateURLService(static_cast<Profile*>(profile), NULL, |  135     Profile* profile = static_cast<Profile*>(context); | 
|  134                                   base::Closure()); |  136     return new TemplateURLService( | 
 |  137         profile->GetPrefs(), make_scoped_ptr(new SearchTermsData), NULL, | 
 |  138         scoped_ptr<KeywordHistoryServiceInterface>( | 
 |  139             new KeywordHistoryService(profile)), NULL, NULL, base::Closure()); | 
|  135   } |  140   } | 
|  136  |  141  | 
|  137   virtual void SetUp(); |  142   virtual void SetUp(); | 
|  138   virtual void TearDown(); |  143   virtual void TearDown(); | 
|  139  |  144  | 
|  140   virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); |  145   virtual void GetTestData(size_t* data_count, TestURLInfo** test_data); | 
|  141  |  146  | 
|  142   // Fills test data into the history system. |  147   // Fills test data into the history system. | 
|  143   void FillData(); |  148   void FillData(); | 
|  144  |  149  | 
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  734  |  739  | 
|  735 TEST_F(HQPOrderingTest, TEAMatch) { |  740 TEST_F(HQPOrderingTest, TEAMatch) { | 
|  736   std::vector<std::string> expected_urls; |  741   std::vector<std::string> expected_urls; | 
|  737   expected_urls.push_back("http://www.teamliquid.net/"); |  742   expected_urls.push_back("http://www.teamliquid.net/"); | 
|  738   expected_urls.push_back("http://www.teamliquid.net/tlpd"); |  743   expected_urls.push_back("http://www.teamliquid.net/tlpd"); | 
|  739   expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); |  744   expected_urls.push_back("http://www.teamliquid.net/tlpd/korean/players"); | 
|  740   RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, |  745   RunTest(ASCIIToUTF16("tea"), false, expected_urls, true, | 
|  741           ASCIIToUTF16("www.teamliquid.net"), |  746           ASCIIToUTF16("www.teamliquid.net"), | 
|  742                  ASCIIToUTF16("mliquid.net")); |  747                  ASCIIToUTF16("mliquid.net")); | 
|  743 } |  748 } | 
| OLD | NEW |