| Index: net/base/port_util_unittest.cc
|
| diff --git a/net/spdy/spdy_header_block_unittest.cc b/net/base/port_util_unittest.cc
|
| similarity index 31%
|
| copy from net/spdy/spdy_header_block_unittest.cc
|
| copy to net/base/port_util_unittest.cc
|
| index 99e9ac21b535432f9320fedfeb552751125cb1c9..6bd163f7a8ffaefa4cff2091aeda35c040aa7831 100644
|
| --- a/net/spdy/spdy_header_block_unittest.cc
|
| +++ b/net/base/port_util_unittest.cc
|
| @@ -2,30 +2,27 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "net/spdy/spdy_header_block.h"
|
| +#include "net/base/port_util.h"
|
| +
|
| +#include <string>
|
|
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "base/values.h"
|
| -#include "net/log/net_log.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| namespace net {
|
|
|
| -namespace {
|
| -
|
| -TEST(SpdyHeaderBlockTest, ToNetLogParamAndBackAgain) {
|
| - SpdyHeaderBlock headers;
|
| - headers["A"] = "a";
|
| - headers["B"] = "b";
|
| +TEST(NetUtilTest, SetExplicitlyAllowedPortsTest) {
|
| + std::string invalid[] = {"1,2,a", "'1','2'", "1, 2, 3", "1 0,11,12"};
|
| + std::string valid[] = {"", "1", "1,2", "1,2,3", "10,11,12,13"};
|
|
|
| - scoped_ptr<base::Value> event_param(SpdyHeaderBlockNetLogCallback(
|
| - &headers, NetLogCaptureMode::IncludeCookiesAndCredentials()));
|
| + for (size_t i = 0; i < arraysize(invalid); ++i) {
|
| + SetExplicitlyAllowedPorts(invalid[i]);
|
| + EXPECT_EQ(0, static_cast<int>(GetCountOfExplicitlyAllowedPorts()));
|
| + }
|
|
|
| - SpdyHeaderBlock headers2;
|
| - ASSERT_TRUE(SpdyHeaderBlockFromNetLogParam(event_param.get(), &headers2));
|
| - EXPECT_EQ(headers, headers2);
|
| + for (size_t i = 0; i < arraysize(valid); ++i) {
|
| + SetExplicitlyAllowedPorts(valid[i]);
|
| + EXPECT_EQ(i, GetCountOfExplicitlyAllowedPorts());
|
| + }
|
| }
|
|
|
| -} // namespace
|
| -
|
| } // namespace net
|
|
|