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

Unified Diff: net/websockets/websocket_end_to_end_test.cc

Issue 1378123003: Adding SSL ETS Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ets
Patch Set: Rebase. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/websockets/websocket_end_to_end_test.cc
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index fef2809557028d433fb288faa2142c1467d33072..c8cb10eecbbc7df9b297240916935e9344e43cf6 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -24,6 +24,7 @@
#include "net/base/network_delegate.h"
#include "net/base/test_data_directory.h"
#include "net/proxy/proxy_service.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
#include "net/url_request/url_request_test_util.h"
#include "net/websockets/websocket_channel.h"
@@ -388,22 +389,22 @@ TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(TruncatedResponse)) {
// Regression test for crbug.com/455215 "HSTS not applied to WebSocket"
TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HstsHttpsToWebSocket)) {
+ EmbeddedTestServer https_server(net::EmbeddedTestServer::Type::TYPE_HTTPS);
+ https_server.SetSSLConfig(
+ net::EmbeddedTestServer::CERT_COMMON_NAME_IS_DOMAIN);
+ https_server.ServeFilesFromSourceDirectory("net/data/url_request_unittest");
+
SpawnedTestServer::SSLOptions ssl_options(
SpawnedTestServer::SSLOptions::CERT_COMMON_NAME_IS_DOMAIN);
- SpawnedTestServer https_server(
- SpawnedTestServer::TYPE_HTTPS, ssl_options,
- base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest")));
SpawnedTestServer wss_server(SpawnedTestServer::TYPE_WSS, ssl_options,
GetWebSocketTestDataDirectory());
- ASSERT_TRUE(https_server.StartInBackground());
- ASSERT_TRUE(wss_server.StartInBackground());
- ASSERT_TRUE(https_server.BlockUntilStarted());
- ASSERT_TRUE(wss_server.BlockUntilStarted());
+ ASSERT_TRUE(https_server.Start());
+ ASSERT_TRUE(wss_server.Start());
InitialiseContext();
// Set HSTS via https:
TestDelegate delegate;
- GURL https_page = https_server.GetURL("files/hsts-headers.html");
+ GURL https_page = https_server.GetURL("/hsts-headers.html");
scoped_ptr<URLRequest> request(
context_.CreateRequest(https_page, DEFAULT_PRIORITY, &delegate));
request->Start();
@@ -418,17 +419,17 @@ TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HstsHttpsToWebSocket)) {
}
TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HstsWebSocketToHttps)) {
+ EmbeddedTestServer https_server(net::EmbeddedTestServer::Type::TYPE_HTTPS);
+ https_server.SetSSLConfig(
+ net::EmbeddedTestServer::CERT_COMMON_NAME_IS_DOMAIN);
+ https_server.ServeFilesFromSourceDirectory("net/data/url_request_unittest");
+
SpawnedTestServer::SSLOptions ssl_options(
SpawnedTestServer::SSLOptions::CERT_COMMON_NAME_IS_DOMAIN);
- SpawnedTestServer https_server(
- SpawnedTestServer::TYPE_HTTPS, ssl_options,
- base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest")));
SpawnedTestServer wss_server(SpawnedTestServer::TYPE_WSS, ssl_options,
GetWebSocketTestDataDirectory());
- ASSERT_TRUE(https_server.StartInBackground());
- ASSERT_TRUE(wss_server.StartInBackground());
- ASSERT_TRUE(https_server.BlockUntilStarted());
- ASSERT_TRUE(wss_server.BlockUntilStarted());
+ ASSERT_TRUE(https_server.Start());
+ ASSERT_TRUE(wss_server.Start());
InitialiseContext();
// Set HSTS via wss:
GURL wss_url = wss_server.GetURL("set-hsts");
@@ -437,7 +438,7 @@ TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HstsWebSocketToHttps)) {
// Verify via http:
TestDelegate delegate;
GURL http_page =
- ReplaceUrlScheme(https_server.GetURL("files/simple.html"), "http");
+ ReplaceUrlScheme(https_server.GetURL("/simple.html"), "http");
scoped_ptr<URLRequest> request(
context_.CreateRequest(http_page, DEFAULT_PRIORITY, &delegate));
request->Start();
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | sync/internal_api/attachments/attachment_uploader_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698