| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/app_list/search/mixer.h" | 5 #include "ui/app_list/search/mixer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 set_relevance(relevance); | 39 set_relevance(relevance); |
| 40 } | 40 } |
| 41 ~TestSearchResult() override {} | 41 ~TestSearchResult() override {} |
| 42 | 42 |
| 43 using SearchResult::set_voice_result; | 43 using SearchResult::set_voice_result; |
| 44 | 44 |
| 45 // SearchResult overrides: | 45 // SearchResult overrides: |
| 46 void Open(int event_flags) override {} | 46 void Open(int event_flags) override {} |
| 47 void InvokeAction(int action_index, int event_flags) override {} | 47 void InvokeAction(int action_index, int event_flags) override {} |
| 48 std::unique_ptr<SearchResult> Duplicate() const override { | 48 std::unique_ptr<SearchResult> Duplicate() const override { |
| 49 return base::WrapUnique(new TestSearchResult(id(), relevance())); | 49 return base::MakeUnique<TestSearchResult>(id(), relevance()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // For reference equality testing. (Addresses cannot be used to test reference | 52 // For reference equality testing. (Addresses cannot be used to test reference |
| 53 // equality because it is possible that an object will be allocated at the | 53 // equality because it is possible that an object will be allocated at the |
| 54 // same address as a previously deleted one.) | 54 // same address as a previously deleted one.) |
| 55 static int GetInstanceId(SearchResult* result) { | 55 static int GetInstanceId(SearchResult* result) { |
| 56 return static_cast<const TestSearchResult*>(result)->instance_id_; | 56 return static_cast<const TestSearchResult*>(result)->instance_id_; |
| 57 } | 57 } |
| 58 | 58 |
| 59 private: | 59 private: |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 EXPECT_EQ(old_ui_result_ids[0], | 403 EXPECT_EQ(old_ui_result_ids[0], |
| 404 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); | 404 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); |
| 405 EXPECT_EQ(old_ui_result_ids[1], | 405 EXPECT_EQ(old_ui_result_ids[1], |
| 406 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); | 406 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); |
| 407 EXPECT_EQ(old_ui_result_ids[2], | 407 EXPECT_EQ(old_ui_result_ids[2], |
| 408 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); | 408 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace test | 411 } // namespace test |
| 412 } // namespace app_list | 412 } // namespace app_list |
| OLD | NEW |