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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « no previous file | ui/app_list/views/app_list_view_unittest.cc » ('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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698