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

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

Issue 2230193002: remoting: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 while (true) { 411 while (true) {
412 uint32_t length; 412 uint32_t length;
413 int read_result = output_read_file_.ReadAtCurrentPos( 413 int read_result = output_read_file_.ReadAtCurrentPos(
414 reinterpret_cast<char*>(&length), sizeof(length)); 414 reinterpret_cast<char*>(&length), sizeof(length));
415 if (read_result != sizeof(length)) { 415 if (read_result != sizeof(length)) {
416 return nullptr; 416 return nullptr;
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 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(
(...skipping 211 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/security_key/security_key_message_writer_impl_unittest.cc ('k') | remoting/host/touch_injector_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698