1 // Copyright 2015 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.
6 #include "platform/weborigin/KnownPorts.h"
8 #include <gtest/gtest.h>
12 TEST(KnownPortsTest
, IsDefaultPortForProtocol
)
15 const unsigned short port
;
21 { 443, "https", true },
25 { 990, "ftps", true },
29 { 80, "http:", false },
30 { 443, "http", false },
31 { 21, "ftps", false },
32 { 990, "ftp", false },
35 { 80, "HTTP", false },
36 { 443, "Https", false },
39 for (const TestCase
& test
: inputs
) {
40 bool result
= isDefaultPortForProtocol(test
.port
, test
.protocol
);
41 EXPECT_EQ(test
.isKnown
, result
);
45 TEST(KnownPortsTest
, DefaultPortForProtocol
)
48 const unsigned short port
;
66 for (const TestCase
& test
: inputs
)
67 EXPECT_EQ(test
.port
, defaultPortForProtocol(test
.protocol
));