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

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc

Issue 2257113002: 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <memory> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 : HotwordService(profile), service_available_(true) {} 97 : HotwordService(profile), service_available_(true) {}
98 ~MockHotwordService() override {} 98 ~MockHotwordService() override {}
99 99
100 bool IsServiceAvailable() override { return service_available_; } 100 bool IsServiceAvailable() override { return service_available_; }
101 101
102 void setServiceAvailable(bool available) { 102 void setServiceAvailable(bool available) {
103 service_available_ = available; 103 service_available_ = available;
104 } 104 }
105 105
106 static std::unique_ptr<KeyedService> Build(content::BrowserContext* profile) { 106 static std::unique_ptr<KeyedService> Build(content::BrowserContext* profile) {
107 return base::WrapUnique( 107 return base::MakeUnique<MockHotwordService>(static_cast<Profile*>(profile));
108 new MockHotwordService(static_cast<Profile*>(profile)));
109 } 108 }
110 109
111 LaunchMode GetHotwordAudioVerificationLaunchMode() override { 110 LaunchMode GetHotwordAudioVerificationLaunchMode() override {
112 return launch_mode_; 111 return launch_mode_;
113 } 112 }
114 113
115 void SetHotwordAudioVerificationLaunchMode(const LaunchMode& launch_mode) { 114 void SetHotwordAudioVerificationLaunchMode(const LaunchMode& launch_mode) {
116 launch_mode_ = launch_mode; 115 launch_mode_ = launch_mode;
117 } 116 }
118 117
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 ExtensionTestMessageListener setListenerF("set AH False: false failure", 535 ExtensionTestMessageListener setListenerF("set AH False: false failure",
537 false); 536 false);
538 ExtensionTestMessageListener getListener("get AH: false failure", false); 537 ExtensionTestMessageListener getListener("get AH: false failure", false);
539 538
540 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_; 539 ASSERT_TRUE(RunComponentExtensionTest("audioHistory")) << message_;
541 540
542 EXPECT_TRUE(setListenerT.WaitUntilSatisfied()); 541 EXPECT_TRUE(setListenerT.WaitUntilSatisfied());
543 EXPECT_TRUE(setListenerF.WaitUntilSatisfied()); 542 EXPECT_TRUE(setListenerF.WaitUntilSatisfied());
544 EXPECT_TRUE(getListener.WaitUntilSatisfied()); 543 EXPECT_TRUE(getListener.WaitUntilSatisfied());
545 } 544 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698