| OLD | NEW |
| 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 namespace protocol { | |
| 11 | 10 |
| 12 TEST(HostSessionOptionsTest, ShouldBeAbleToAppendOptions) { | 11 TEST(HostSessionOptionsTest, ShouldBeAbleToAppendOptions) { |
| 13 HostSessionOptions options; | 12 HostSessionOptions options; |
| 14 options.Import("A:, B C :1, DE:2, EF"); | 13 options.Import("A:, B C :1, DE:2, EF"); |
| 15 ASSERT_TRUE(options.Get("A")); | 14 ASSERT_TRUE(options.Get("A")); |
| 16 ASSERT_EQ(*options.Get("B C "), "1"); | 15 ASSERT_EQ(*options.Get("B C "), "1"); |
| 17 ASSERT_EQ(*options.Get("DE"), "2"); | 16 ASSERT_EQ(*options.Get("DE"), "2"); |
| 18 ASSERT_FALSE(options.Get("EF")); | 17 ASSERT_FALSE(options.Get("EF")); |
| 19 ASSERT_FALSE(options.Get(" EF")); | 18 ASSERT_FALSE(options.Get(" EF")); |
| 20 ASSERT_FALSE(options.Get("--FF")); | 19 ASSERT_FALSE(options.Get("--FF")); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 45 HostSessionOptions options; | 44 HostSessionOptions options; |
| 46 options.Import("A:,B:,C:D,E:V"); | 45 options.Import("A:,B:,C:D,E:V"); |
| 47 std::string result = options.Export(); | 46 std::string result = options.Export(); |
| 48 | 47 |
| 49 HostSessionOptions other; | 48 HostSessionOptions other; |
| 50 other.Append("C", "X"); | 49 other.Append("C", "X"); |
| 51 other.Import(result); | 50 other.Import(result); |
| 52 ASSERT_EQ(options.Export(), other.Export()); | 51 ASSERT_EQ(options.Export(), other.Export()); |
| 53 } | 52 } |
| 54 | 53 |
| 55 } // namespace protocol | |
| 56 } // namespace remoting | 54 } // namespace remoting |
| OLD | NEW |