| 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 "remoting/host/setup/me2me_native_messaging_host.h" | 5 #include "remoting/host/setup/me2me_native_messaging_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstdint> | 9 #include <cstdint> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 MockDaemonControllerDelegate::MockDaemonControllerDelegate() {} | 191 MockDaemonControllerDelegate::MockDaemonControllerDelegate() {} |
| 192 | 192 |
| 193 MockDaemonControllerDelegate::~MockDaemonControllerDelegate() {} | 193 MockDaemonControllerDelegate::~MockDaemonControllerDelegate() {} |
| 194 | 194 |
| 195 DaemonController::State MockDaemonControllerDelegate::GetState() { | 195 DaemonController::State MockDaemonControllerDelegate::GetState() { |
| 196 return DaemonController::STATE_STARTED; | 196 return DaemonController::STATE_STARTED; |
| 197 } | 197 } |
| 198 | 198 |
| 199 std::unique_ptr<base::DictionaryValue> | 199 std::unique_ptr<base::DictionaryValue> |
| 200 MockDaemonControllerDelegate::GetConfig() { | 200 MockDaemonControllerDelegate::GetConfig() { |
| 201 return base::WrapUnique(new base::DictionaryValue()); | 201 return base::MakeUnique<base::DictionaryValue>(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void MockDaemonControllerDelegate::SetConfigAndStart( | 204 void MockDaemonControllerDelegate::SetConfigAndStart( |
| 205 std::unique_ptr<base::DictionaryValue> config, | 205 std::unique_ptr<base::DictionaryValue> config, |
| 206 bool consent, | 206 bool consent, |
| 207 const DaemonController::CompletionCallback& done) { | 207 const DaemonController::CompletionCallback& done) { |
| 208 // Verify parameters passed in. | 208 // Verify parameters passed in. |
| 209 if (consent && config && config->HasKey("start")) { | 209 if (consent && config && config->HasKey("start")) { |
| 210 done.Run(DaemonController::RESULT_OK); | 210 done.Run(DaemonController::RESULT_OK); |
| 211 } else { | 211 } else { |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 } | 643 } |
| 644 | 644 |
| 645 // Verify rejection if getCredentialsFromAuthCode has no auth code. | 645 // Verify rejection if getCredentialsFromAuthCode has no auth code. |
| 646 TEST_F(Me2MeNativeMessagingHostTest, GetCredentialsFromAuthCodeNoAuthCode) { | 646 TEST_F(Me2MeNativeMessagingHostTest, GetCredentialsFromAuthCodeNoAuthCode) { |
| 647 base::DictionaryValue message; | 647 base::DictionaryValue message; |
| 648 message.SetString("type", "getCredentialsFromAuthCode"); | 648 message.SetString("type", "getCredentialsFromAuthCode"); |
| 649 TestBadRequest(message); | 649 TestBadRequest(message); |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace remoting | 652 } // namespace remoting |
| OLD | NEW |