| 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/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/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 24 matching lines...) Expand all Loading... |
| 35 protected: | 35 protected: |
| 36 base::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 ASSERT_TRUE(profile_->CreateHistoryService(true, false)); |
| 46 profile_->BlockUntilHistoryProcessesPendingRequests(); | 46 profile_->BlockUntilHistoryProcessesPendingRequests(); |
| 47 history_service_ = | 47 history_service_ = |
| 48 HistoryServiceFactory::GetForProfile(profile_.get(), | 48 HistoryServiceFactory::GetForProfile(profile_.get(), |
| 49 Profile::EXPLICIT_ACCESS); | 49 Profile::EXPLICIT_ACCESS); |
| 50 | 50 |
| 51 app_provider_ = new ExtensionAppProvider(NULL, profile_.get()); | 51 app_provider_ = new ExtensionAppProvider(NULL, profile_.get()); |
| 52 | 52 |
| 53 struct TestExtensionApp { | 53 struct TestExtensionApp { |
| 54 const char* app_name; | 54 const char* app_name; |
| 55 const char* launch_url; | 55 const char* launch_url; |
| (...skipping 88 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 |