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

Side by Side Diff: remoting/host/it2me/it2me_native_messaging_host_unittest.cc

Issue 138833009: For C++ readability review. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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/it2me/it2me_native_messaging_host.h" 5 #include "remoting/host/it2me/it2me_native_messaging_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 #include "base/strings/stringize_macros.h" 14 #include "base/strings/stringize_macros.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "net/base/file_stream.h" 16 #include "net/base/file_stream.h"
17 #include "net/base/net_util.h" 17 #include "net/base/net_util.h"
18 #include "remoting/base/auto_thread_task_runner.h" 18 #include "remoting/base/auto_thread_task_runner.h"
19 #include "remoting/host/chromoting_host_context.h" 19 #include "remoting/host/chromoting_host_context.h"
20 #include "remoting/host/native_messaging/native_messaging_channel.h" 20 #include "remoting/host/native_messaging/native_messaging_channel.h"
21 #include "remoting/host/setup/test_util.h" 21 #include "remoting/host/setup/test_util.h"
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 namespace { 24 namespace {
nadav 2014/02/06 08:23:49 You probably want the unnamed namespace *inside* t
weitao 2014/02/19 00:40:03 Done.
25 25
26 const char kTestAccessCode[] = "888888"; 26 const char kTestAccessCode[] = "888888";
27 const int kTestAccessCodeLifetimeInSeconds = 666; 27 const int kTestAccessCodeLifetimeInSeconds = 666;
28 const char kTestClientUsername[] = "some_user@gmail.com"; 28 const char kTestClientUsername[] = "some_user@gmail.com";
29 29
30 void VerifyId(scoped_ptr<base::DictionaryValue> response, int expected_value) { 30 void VerifyId(scoped_ptr<base::DictionaryValue> response, int expected_value) {
31 ASSERT_TRUE(response); 31 ASSERT_TRUE(response);
32 32
33 int value; 33 int value;
34 EXPECT_TRUE(response->GetInteger("id", &value)); 34 EXPECT_TRUE(response->GetInteger("id", &value));
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 546
547 // Verify rejection if type is unrecognized. 547 // Verify rejection if type is unrecognized.
548 TEST_F(It2MeNativeMessagingHostTest, InvalidType) { 548 TEST_F(It2MeNativeMessagingHostTest, InvalidType) {
549 base::DictionaryValue message; 549 base::DictionaryValue message;
550 message.SetString("type", "xxx"); 550 message.SetString("type", "xxx");
551 TestBadRequest(message, true); 551 TestBadRequest(message, true);
552 } 552 }
553 553
554 } // namespace remoting 554 } // namespace remoting
555
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698