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

Side by Side Diff: remoting/host/setup/me2me_native_messaging_host_unittest.cc

Issue 2034393004: Allow multiple logging::LogMessage{Handler,Listener}s Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 11 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 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 std::unique_ptr<base::Value> message = base::JSONReader::Read(message_json); 426 std::unique_ptr<base::Value> message = base::JSONReader::Read(message_json);
427 if (!message || !message->IsType(base::Value::Type::DICTIONARY)) { 427 if (!message || !message->IsType(base::Value::Type::DICTIONARY)) {
428 return nullptr; 428 return nullptr;
429 } 429 }
430 430
431 std::unique_ptr<base::DictionaryValue> result = base::WrapUnique( 431 std::unique_ptr<base::DictionaryValue> result = base::WrapUnique(
432 static_cast<base::DictionaryValue*>(message.release())); 432 static_cast<base::DictionaryValue*>(message.release()));
433 std::string type; 433 std::string type;
434 // If this is a debug message log, ignore it, otherwise return it. 434 // If this is a debug message log, ignore it, otherwise return it.
435 if (!result->GetString("type", &type) || 435 if (!result->GetString("type", &type) ||
436 type != LogMessageHandler::kDebugMessageTypeName) { 436 type != LogMessageListener::kDebugMessageTypeName) {
437 return result; 437 return result;
438 } 438 }
439 } 439 }
440 } 440 }
441 441
442 void Me2MeNativeMessagingHostTest::WriteMessageToInputPipe( 442 void Me2MeNativeMessagingHostTest::WriteMessageToInputPipe(
443 const base::Value& message) { 443 const base::Value& message) {
444 std::string message_json; 444 std::string message_json;
445 base::JSONWriter::Write(message, &message_json); 445 base::JSONWriter::Write(message, &message_json);
446 446
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « remoting/host/setup/me2me_native_messaging_host.cc ('k') | third_party/crashpad/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698