| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/weborigin/KnownPorts.h" | 6 #include "platform/weborigin/KnownPorts.h" |
| 7 | 7 |
| 8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
| 9 | 9 |
| 10 using blink::isDefaultPortForProtocol; | 10 namespace blink { |
| 11 | |
| 12 namespace { | |
| 13 | 11 |
| 14 TEST(KnownPortsTest, IsDefaultPortForProtocol) | 12 TEST(KnownPortsTest, IsDefaultPortForProtocol) |
| 15 { | 13 { |
| 16 struct TestCase { | 14 struct TestCase { |
| 17 const unsigned short port; | 15 const unsigned short port; |
| 18 const char* protocol; | 16 const char* protocol; |
| 19 const bool isKnown; | 17 const bool isKnown; |
| 20 }; | 18 }; |
| 21 | 19 |
| 22 TestCase inputs[] = { | 20 TestCase inputs[] = { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 37 { 80, "HTTP", false }, | 35 { 80, "HTTP", false }, |
| 38 { 443, "Https", false }, | 36 { 443, "Https", false }, |
| 39 }; | 37 }; |
| 40 | 38 |
| 41 for (TestCase test : inputs) { | 39 for (TestCase test : inputs) { |
| 42 bool result = isDefaultPortForProtocol(test.port, test.protocol); | 40 bool result = isDefaultPortForProtocol(test.port, test.protocol); |
| 43 EXPECT_EQ(test.isKnown, result); | 41 EXPECT_EQ(test.isKnown, result); |
| 44 } | 42 } |
| 45 } | 43 } |
| 46 | 44 |
| 47 } | 45 } // namespace blink |
| OLD | NEW |