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

Unified Diff: net/url_request/url_request_unittest.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request.cc ('k') | skia/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_unittest.cc
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index b114ecc2dfe8509e3a951d1ede8e63417f25ebd5..099a31988bbd37238774fd46c9252c3dc638170d 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -10,7 +10,6 @@
#endif
#include <algorithm>
-#include <string>
#include "base/basictypes.h"
#include "base/bind.h"
@@ -99,6 +98,7 @@
using base::ASCIIToUTF16;
using base::Time;
+using std::string;
namespace net {
@@ -5437,6 +5437,25 @@ TEST_F(URLRequestTestHTTP, NoCacheOnNetworkDelegateRedirect) {
}
}
+// Make sure an HTTP request using the "unsafe" port 443 fails.
+// See: https://crbug.com/436451
+TEST_F(URLRequestTestHTTP, UnsafePort) {
+ TestDelegate d;
+ {
+ scoped_ptr<URLRequest> r(default_context_.CreateRequest(
+ GURL("http://www.google.com:443/"), DEFAULT_PRIORITY, &d, NULL));
+
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_FALSE(r->is_pending());
+ EXPECT_EQ(URLRequestStatus::FAILED, r->status().status());
+ EXPECT_EQ(ERR_UNSAFE_PORT, r->status().error());
+ }
+}
+
// Tests that redirection to an unsafe URL is allowed when it has been marked as
// safe.
TEST_F(URLRequestTestHTTP, UnsafeRedirectToWhitelistedUnsafeURL) {
« no previous file with comments | « net/url_request/url_request.cc ('k') | skia/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698