Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: ui/app_list/search/mixer_unittest.cc

Issue 898273002: app_list::SearchResult: Duplicate() is const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/search/mixer.cc ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/app_list/search/mixer.cc ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698