| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #import <CoreSpotlight/CoreSpotlight.h> | 7 #import <CoreSpotlight/CoreSpotlight.h> |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 result.icon_type = favicon_base::TOUCH_ICON; | 60 result.icon_type = favicon_base::TOUCH_ICON; |
| 61 CHECK(result.is_valid()); | 61 CHECK(result.is_valid()); |
| 62 return result; | 62 return result; |
| 63 } | 63 } |
| 64 | 64 |
| 65 class SpotlightManagerTest : public testing::Test { | 65 class SpotlightManagerTest : public testing::Test { |
| 66 protected: | 66 protected: |
| 67 SpotlightManagerTest() { | 67 SpotlightManagerTest() { |
| 68 model_ = bookmarks::TestBookmarkClient::CreateModel(); | 68 model_ = bookmarks::TestBookmarkClient::CreateModel(); |
| 69 large_icon_service_.reset(new favicon::LargeIconService( | 69 large_icon_service_.reset(new favicon::LargeIconService( |
| 70 &mock_favicon_service_, base::ThreadTaskRunnerHandle::Get())); | 70 &mock_favicon_service_, base::ThreadTaskRunnerHandle::Get(), |
| 71 /*image_fetcher=*/nullptr)); |
| 71 bookmarksSpotlightManager_ = [[BookmarksSpotlightManager alloc] | 72 bookmarksSpotlightManager_ = [[BookmarksSpotlightManager alloc] |
| 72 initWithLargeIconService:large_icon_service_.get() | 73 initWithLargeIconService:large_icon_service_.get() |
| 73 bookmarkModel:model_.get()]; | 74 bookmarkModel:model_.get()]; |
| 74 | 75 |
| 75 EXPECT_CALL(mock_favicon_service_, | 76 EXPECT_CALL(mock_favicon_service_, |
| 76 GetLargestRawFaviconForPageURL(_, _, _, _, _)) | 77 GetLargestRawFaviconForPageURL(_, _, _, _, _)) |
| 77 .WillRepeatedly(PostReply<5>(CreateTestBitmap(24, 24))); | 78 .WillRepeatedly(PostReply<5>(CreateTestBitmap(24, 24))); |
| 78 } | 79 } |
| 79 | 80 |
| 80 base::MessageLoop loop_; | 81 base::MessageLoop loop_; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 NSSet* spotlightManagerKeywords = | 167 NSSet* spotlightManagerKeywords = |
| 167 [NSSet setWithArray:[[item attributeSet] keywords]]; | 168 [NSSet setWithArray:[[item attributeSet] keywords]]; |
| 168 EXPECT_TRUE([spotlightManagerKeywords count] > 0); | 169 EXPECT_TRUE([spotlightManagerKeywords count] > 0); |
| 169 // Check static/hardcoded keywords exist | 170 // Check static/hardcoded keywords exist |
| 170 NSSet* hardCodedKeywordsSet = | 171 NSSet* hardCodedKeywordsSet = |
| 171 [NSSet setWithArray:ios::GetChromeBrowserProvider() | 172 [NSSet setWithArray:ios::GetChromeBrowserProvider() |
| 172 ->GetSpotlightProvider() | 173 ->GetSpotlightProvider() |
| 173 ->GetAdditionalKeywords()]; | 174 ->GetAdditionalKeywords()]; |
| 174 EXPECT_TRUE([hardCodedKeywordsSet isSubsetOfSet:spotlightManagerKeywords]); | 175 EXPECT_TRUE([hardCodedKeywordsSet isSubsetOfSet:spotlightManagerKeywords]); |
| 175 } | 176 } |
| OLD | NEW |