Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: content/child/blink_platform_impl_unittest.cc

Issue 1036823003: Fix to respect --explicitly-allowed-ports command line option-Chromium Side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (i == 0 || i == 10 || i == 127 || i > 223) { 113 if (i == 0 || i == 10 || i == 127 || i > 223) {
114 EXPECT_TRUE(platform_impl.isReservedIPAddress( 114 EXPECT_TRUE(platform_impl.isReservedIPAddress(
115 blink::WebString::fromUTF8(addressString))); 115 blink::WebString::fromUTF8(addressString)));
116 } else { 116 } else {
117 EXPECT_FALSE(platform_impl.isReservedIPAddress( 117 EXPECT_FALSE(platform_impl.isReservedIPAddress(
118 blink::WebString::fromUTF8(addressString))); 118 blink::WebString::fromUTF8(addressString)));
119 } 119 }
120 } 120 }
121 } 121 }
122 122
123 TEST(BlinkPlatformTest, portAllowed) {
124 TestBlinkPlatformImpl platform_impl;
125 EXPECT_TRUE(platform_impl.portAllowed(GURL("http://example.com")));
126 EXPECT_TRUE(platform_impl.portAllowed(GURL("file://example.com")));
127 EXPECT_TRUE(platform_impl.portAllowed(GURL("file://example.com:87")));
128 EXPECT_TRUE(platform_impl.portAllowed(GURL("ftp://example.com:21")));
129 EXPECT_FALSE(platform_impl.portAllowed(GURL("ftp://example.com:87")));
130 EXPECT_FALSE(platform_impl.portAllowed(GURL("ws://example.com:21")));
131 EXPECT_TRUE(platform_impl.portAllowed(GURL("http://example.com:80")));
132 EXPECT_TRUE(platform_impl.portAllowed(GURL("http://example.com:8889")));
133 }
134
123 } // namespace content 135 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698