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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 418
419 std::string message_json(length, '\0'); 419 std::string message_json(length, '\0');
420 read_result = output_read_file_.ReadAtCurrentPos( 420 read_result = output_read_file_.ReadAtCurrentPos(
421 base::string_as_array(&message_json), length); 421 base::string_as_array(&message_json), length);
422 if (read_result != static_cast<int>(length)) { 422 if (read_result != static_cast<int>(length)) {
423 return nullptr; 423 return nullptr;
424 } 424 }
425 425
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 != LogMessageHandler::kDebugMessageTypeName) {
437 return result; 437 return result;
(...skipping 205 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') | remoting/host/setup/service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698