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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 set_title(base::UTF8ToUTF16(id)); | 27 set_title(base::UTF8ToUTF16(id)); |
28 set_relevance(relevance); | 28 set_relevance(relevance); |
29 } | 29 } |
30 ~TestSearchResult() override {} | 30 ~TestSearchResult() override {} |
31 | 31 |
32 using SearchResult::set_voice_result; | 32 using SearchResult::set_voice_result; |
33 | 33 |
34 // SearchResult overrides: | 34 // SearchResult overrides: |
35 void Open(int event_flags) override {} | 35 void Open(int event_flags) override {} |
36 void InvokeAction(int action_index, int event_flags) override {} | 36 void InvokeAction(int action_index, int event_flags) override {} |
37 scoped_ptr<SearchResult> Duplicate() override { | 37 scoped_ptr<SearchResult> Duplicate() const override { |
38 return scoped_ptr<SearchResult>(new TestSearchResult(id(), relevance())); | 38 return scoped_ptr<SearchResult>(new TestSearchResult(id(), relevance())); |
39 } | 39 } |
40 | 40 |
41 // For reference equality testing. (Addresses cannot be used to test reference | 41 // For reference equality testing. (Addresses cannot be used to test reference |
42 // equality because it is possible that an object will be allocated at the | 42 // equality because it is possible that an object will be allocated at the |
43 // same address as a previously deleted one.) | 43 // same address as a previously deleted one.) |
44 static int GetInstanceId(SearchResult* result) { | 44 static int GetInstanceId(SearchResult* result) { |
45 return static_cast<const TestSearchResult*>(result)->instance_id_; | 45 return static_cast<const TestSearchResult*>(result)->instance_id_; |
46 } | 46 } |
47 | 47 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 EXPECT_EQ(old_ui_result_ids[0], | 323 EXPECT_EQ(old_ui_result_ids[0], |
324 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); | 324 TestSearchResult::GetInstanceId(ui_results.GetItemAt(3))); |
325 EXPECT_EQ(old_ui_result_ids[1], | 325 EXPECT_EQ(old_ui_result_ids[1], |
326 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); | 326 TestSearchResult::GetInstanceId(ui_results.GetItemAt(0))); |
327 EXPECT_EQ(old_ui_result_ids[2], | 327 EXPECT_EQ(old_ui_result_ids[2], |
328 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); | 328 TestSearchResult::GetInstanceId(ui_results.GetItemAt(2))); |
329 } | 329 } |
330 | 330 |
331 } // namespace test | 331 } // namespace test |
332 } // namespace app_list | 332 } // namespace app_list |
OLD | NEW |