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

Side by Side Diff: components/translate/core/browser/translate_ui_delegate_unittest.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/translate/core/browser/translate_ui_delegate.h" 5 #include "components/translate/core/browser/translate_ui_delegate.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 26 matching lines...) Expand all
37 37
38 class MockTranslateClient : public TranslateClient { 38 class MockTranslateClient : public TranslateClient {
39 public: 39 public:
40 MockTranslateClient(TranslateDriver* driver, PrefService* prefs) 40 MockTranslateClient(TranslateDriver* driver, PrefService* prefs)
41 : driver_(driver), prefs_(prefs) {} 41 : driver_(driver), prefs_(prefs) {}
42 42
43 TranslateDriver* GetTranslateDriver() { return driver_; } 43 TranslateDriver* GetTranslateDriver() { return driver_; }
44 PrefService* GetPrefs() { return prefs_; } 44 PrefService* GetPrefs() { return prefs_; }
45 45
46 std::unique_ptr<TranslatePrefs> GetTranslatePrefs() { 46 std::unique_ptr<TranslatePrefs> GetTranslatePrefs() {
47 return base::WrapUnique(new TranslatePrefs(prefs_, "intl.accept_languages", 47 return base::MakeUnique<TranslatePrefs>(prefs_, "intl.accept_languages",
48 preferred_languages_prefs)); 48 preferred_languages_prefs);
49 } 49 }
50 50
51 MOCK_METHOD0(GetTranslateAcceptLanguages, TranslateAcceptLanguages*()); 51 MOCK_METHOD0(GetTranslateAcceptLanguages, TranslateAcceptLanguages*());
52 MOCK_CONST_METHOD0(GetInfobarIconID, int()); 52 MOCK_CONST_METHOD0(GetInfobarIconID, int());
53 53
54 MOCK_CONST_METHOD1(CreateInfoBarMock, 54 MOCK_CONST_METHOD1(CreateInfoBarMock,
55 infobars::InfoBar*(TranslateInfoBarDelegate*)); 55 infobars::InfoBar*(TranslateInfoBarDelegate*));
56 std::unique_ptr<infobars::InfoBar> CreateInfoBar( 56 std::unique_ptr<infobars::InfoBar> CreateInfoBar(
57 std::unique_ptr<TranslateInfoBarDelegate> delegate) const { 57 std::unique_ptr<TranslateInfoBarDelegate> delegate) const {
58 return base::WrapUnique(CreateInfoBarMock(std::move(delegate).get())); 58 return base::WrapUnique(CreateInfoBarMock(std::move(delegate).get()));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 prefs->IncrementTranslationAcceptedCount("ar"); 196 prefs->IncrementTranslationAcceptedCount("ar");
197 197
198 EXPECT_FALSE(delegate_->ShouldAlwaysTranslateBeCheckedByDefault()); 198 EXPECT_FALSE(delegate_->ShouldAlwaysTranslateBeCheckedByDefault());
199 } 199 }
200 200
201 // TODO(ftang) Currently this file only test TranslationDeclined(), we 201 // TODO(ftang) Currently this file only test TranslationDeclined(), we
202 // need to add the test for other functions soon to increase the test 202 // need to add the test for other functions soon to increase the test
203 // coverage. 203 // coverage.
204 204
205 } // namespace translate 205 } // namespace translate
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_manager_unittest.cc ('k') | components/undo/undo_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698