Remove IsHighDPIEnabled, move EnableHighDPISupport to only place it's used
[chromium-blink-merge.git] / remoting / protocol / network_settings_unittest.cc
blobc62c51bf6ee12dbd5d7ff3c92dc19ecb452e71ab
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "remoting/protocol/network_settings.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace remoting {
10 namespace protocol {
12 TEST(ParsePortRange, Basic) {
13 int min, max;
15 // Valid range
16 EXPECT_TRUE(NetworkSettings::ParsePortRange("1-65535", &min, &max));
17 EXPECT_EQ(1, min);
18 EXPECT_EQ(65535, max);
20 EXPECT_TRUE(NetworkSettings::ParsePortRange(" 1 - 65535 ", &min, &max));
21 EXPECT_EQ(1, min);
22 EXPECT_EQ(65535, max);
24 EXPECT_TRUE(NetworkSettings::ParsePortRange("12400-12400", &min, &max));
25 EXPECT_EQ(12400, min);
26 EXPECT_EQ(12400, max);
28 // Invalid
29 EXPECT_FALSE(NetworkSettings::ParsePortRange("", &min, &max));
30 EXPECT_FALSE(NetworkSettings::ParsePortRange("-65535", &min, &max));
31 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-", &min, &max));
32 EXPECT_FALSE(NetworkSettings::ParsePortRange("-", &min, &max));
33 EXPECT_FALSE(NetworkSettings::ParsePortRange("-1-65535", &min, &max));
34 EXPECT_FALSE(NetworkSettings::ParsePortRange("1--65535", &min, &max));
35 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65535-", &min, &max));
36 EXPECT_FALSE(NetworkSettings::ParsePortRange("0-65535", &min, &max));
37 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-65536", &min, &max));
38 EXPECT_FALSE(NetworkSettings::ParsePortRange("1-4294967295", &min, &max));
39 EXPECT_FALSE(NetworkSettings::ParsePortRange("10-1", &min, &max));
40 EXPECT_FALSE(NetworkSettings::ParsePortRange("1foo-2bar", &min, &max));
43 } // namespace protocol
44 } // namespace remoting