| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/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/extension_app_provider.h" | 9 #include "chrome/browser/autocomplete/extension_app_provider.h" |
| 10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 : ui_thread_(content::BrowserThread::UI, &message_loop_), | 26 : ui_thread_(content::BrowserThread::UI, &message_loop_), |
| 27 history_service_(NULL) { } | 27 history_service_(NULL) { } |
| 28 virtual ~ExtensionAppProviderTest() { } | 28 virtual ~ExtensionAppProviderTest() { } |
| 29 | 29 |
| 30 virtual void SetUp() OVERRIDE; | 30 virtual void SetUp() OVERRIDE; |
| 31 | 31 |
| 32 void RunTest(test_data* keyword_cases, | 32 void RunTest(test_data* keyword_cases, |
| 33 int num_cases); | 33 int num_cases); |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 MessageLoopForUI message_loop_; | 36 base::MessageLoopForUI message_loop_; |
| 37 content::TestBrowserThread ui_thread_; | 37 content::TestBrowserThread ui_thread_; |
| 38 scoped_refptr<ExtensionAppProvider> app_provider_; | 38 scoped_refptr<ExtensionAppProvider> app_provider_; |
| 39 scoped_ptr<TestingProfile> profile_; | 39 scoped_ptr<TestingProfile> profile_; |
| 40 HistoryService* history_service_; | 40 HistoryService* history_service_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 void ExtensionAppProviderTest::SetUp() { | 43 void ExtensionAppProviderTest::SetUp() { |
| 44 profile_.reset(new TestingProfile()); | 44 profile_.reset(new TestingProfile()); |
| 45 profile_->CreateHistoryService(true, false); | 45 profile_->CreateHistoryService(true, false); |
| 46 profile_->BlockUntilHistoryProcessesPendingRequests(); | 46 profile_->BlockUntilHistoryProcessesPendingRequests(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ExtensionAppProvider::ExtensionApp extension_app = | 144 ExtensionAppProvider::ExtensionApp extension_app = |
| 145 {ASCIIToUTF16(cases[i].name), url, true}; | 145 {ASCIIToUTF16(cases[i].name), url, true}; |
| 146 AutocompleteMatch match = | 146 AutocompleteMatch match = |
| 147 app_provider_->CreateAutocompleteMatch(input, | 147 app_provider_->CreateAutocompleteMatch(input, |
| 148 extension_app, | 148 extension_app, |
| 149 0, | 149 0, |
| 150 string16::npos); | 150 string16::npos); |
| 151 EXPECT_EQ(ASCIIToUTF16(cases[i].match_contents), match.contents); | 151 EXPECT_EQ(ASCIIToUTF16(cases[i].match_contents), match.contents); |
| 152 } | 152 } |
| 153 } | 153 } |
| OLD | NEW |