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

Side by Side Diff: remoting/host/host_session_options_unittest.cc

Issue 2858813002: [Chromoting] Use ProcessStatsSender in host process
Patch Set: Created 3 years, 7 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
« no previous file with comments | « remoting/host/host_session_options.cc ('k') | remoting/host/process_stats_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/host_session_options.h" 5 #include "remoting/host/host_session_options.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace remoting { 9 namespace remoting {
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 HostSessionOptions options; 44 HostSessionOptions options;
45 options.Import("A:,B:,C:D,E:V"); 45 options.Import("A:,B:,C:D,E:V");
46 std::string result = options.Export(); 46 std::string result = options.Export();
47 47
48 HostSessionOptions other; 48 HostSessionOptions other;
49 other.Append("C", "X"); 49 other.Append("C", "X");
50 other.Import(result); 50 other.Import(result);
51 ASSERT_EQ(options.Export(), other.Export()); 51 ASSERT_EQ(options.Export(), other.Export());
52 } 52 }
53 53
54 TEST(HostSessionOptionsTest, ShouldBeAbleToGetBool) {
55 HostSessionOptions options;
56 options.Import("A:,B:x,C:true,D:TRUE,E:1,F:2");
57 ASSERT_TRUE(*options.GetBool("A"));
58 ASSERT_FALSE(*options.GetBool("B"));
59 ASSERT_TRUE(*options.GetBool("C"));
60 ASSERT_TRUE(*options.GetBool("D"));
61 ASSERT_TRUE(*options.GetBool("E"));
62 ASSERT_FALSE(*options.GetBool("F"));
63 ASSERT_FALSE(options.GetBool("G"));
64 }
65
66 TEST(HostSessionOptionsTest, ShouldBeAbleToGetInt) {
67 HostSessionOptions options;
68 options.Import("A:100,B:-200,C:x,D:");
69 ASSERT_EQ(*options.GetInt("A"), 100);
70 ASSERT_EQ(*options.GetInt("B"), -200);
71 ASSERT_FALSE(options.GetInt("C"));
72 ASSERT_FALSE(options.GetInt("D"));
73 }
74
54 } // namespace remoting 75 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/host_session_options.cc ('k') | remoting/host/process_stats_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698