summaryrefslogtreecommitdiffstats
path: root/ppapi/tests
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 19:37:33 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-22 19:37:33 +0000
commit19347a2dd30a2257747fb694e410e443cead24b1 (patch)
treefc9c1bb16576fd1102ab672ac2dbff1afbc50565 /ppapi/tests
parent641bdeb0830b56bd715699126176cc750c10fb92 (diff)
downloadchromium_src-19347a2dd30a2257747fb694e410e443cead24b1.zip
chromium_src-19347a2dd30a2257747fb694e410e443cead24b1.tar.gz
chromium_src-19347a2dd30a2257747fb694e410e443cead24b1.tar.bz2
Revert 128266 - Added a pepper test for SSLHandshake. This starts an SSL server which the test can connect to.
BUG=114626 TEST=Ran pepper TCP tests. Review URL: http://codereview.chromium.org/9791003 TBR=raymes@chromium.org Review URL: https://chromiumcodereview.appspot.com/9836015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests')
-rw-r--r--ppapi/tests/test_case.html7
-rw-r--r--ppapi/tests/test_tcp_socket_private.cc34
-rw-r--r--ppapi/tests/test_tcp_socket_private.h4
-rw-r--r--ppapi/tests/testing_instance.cc3
-rw-r--r--ppapi/tests/testing_instance.h5
5 files changed, 3 insertions, 50 deletions
diff --git a/ppapi/tests/test_case.html b/ppapi/tests/test_case.html
index 071608b..1a11546 100644
--- a/ppapi/tests/test_case.html
+++ b/ppapi/tests/test_case.html
@@ -34,14 +34,11 @@ function AppendFrame(testcase, i) {
var frame = document.createElement("IFRAME");
var mode = ExtractSearchParameter("mode");
var websocket_port = ExtractSearchParameter("websocket_port");
- var ssl_server_port = ExtractSearchParameter("ssl_server_port");
var src = "?testcase=" + testcase;
if (mode == "nacl")
src += "&mode=nacl";
if (websocket_port != "")
src += "&websocket_port=" + websocket_port;
- if (ssl_server_port != "")
- src += "&ssl_server_port=" + ssl_server_port;
frame.setAttribute("src", src);
frame.setAttribute("onload", "LoadNext(" + (i + 1) + ")");
@@ -225,10 +222,6 @@ onload = function() {
var websocket_port = ExtractSearchParameter("websocket_port");
if (websocket_port != "")
obj.setAttribute("websocket_port", websocket_port);
- var ssl_server_port = ExtractSearchParameter("ssl_server_port");
- if (ssl_server_port != "")
- obj.setAttribute("ssl_server_port", ssl_server_port);
-
var container = document.getElementById("container");
container.addEventListener("message", handleTestingMessage, true);
// Register a bad dispatchEvent to make sure it isn't used. See 'EVIL' note
diff --git a/ppapi/tests/test_tcp_socket_private.cc b/ppapi/tests/test_tcp_socket_private.cc
index 6bffe49..ee2d71f 100644
--- a/ppapi/tests/test_tcp_socket_private.cc
+++ b/ppapi/tests/test_tcp_socket_private.cc
@@ -40,16 +40,12 @@ bool TestTCPSocketPrivate::Init() {
if (!GetLocalHostPort(instance_->pp_instance(), &host_, &port_))
return false;
- // Get the port for the SSL server.
- ssl_port_ = instance_->ssl_server_port();
-
return true;
}
void TestTCPSocketPrivate::RunTests(const std::string& filter) {
RUN_TEST_FORCEASYNC_AND_NOT(Basic, filter);
RUN_TEST_FORCEASYNC_AND_NOT(ReadWrite, filter);
- RUN_TEST_FORCEASYNC_AND_NOT(ReadWriteSSL, filter);
RUN_TEST_FORCEASYNC_AND_NOT(ConnectAddress, filter);
}
@@ -95,34 +91,6 @@ std::string TestTCPSocketPrivate::TestReadWrite() {
PASS();
}
-std::string TestTCPSocketPrivate::TestReadWriteSSL() {
- pp::TCPSocketPrivate socket(instance_);
- TestCompletionCallback cb(instance_->pp_instance(), force_async_);
-
- int32_t rv = socket.Connect(host_.c_str(), ssl_port_, cb);
- ASSERT_TRUE(!force_async_ || rv == PP_OK_COMPLETIONPENDING);
- if (rv == PP_OK_COMPLETIONPENDING)
- rv = cb.WaitForResult();
- ASSERT_EQ(PP_OK, rv);
-
- rv = socket.SSLHandshake(host_.c_str(), ssl_port_, cb);
- ASSERT_TRUE(!force_async_ || rv == PP_OK_COMPLETIONPENDING);
- if (rv == PP_OK_COMPLETIONPENDING)
- rv = cb.WaitForResult();
- ASSERT_EQ(PP_OK, rv);
-
- ASSERT_EQ(PP_OK, WriteStringToSocket(&socket, "GET / HTTP/1.0\r\n\r\n"));
-
- // Read up to the first \n and check that it looks like valid HTTP response.
- std::string s;
- ASSERT_EQ(PP_OK, ReadFirstLineFromSocket(&socket, &s));
- ASSERT_TRUE(ValidateHttpResponse(s));
-
- socket.Disconnect();
-
- PASS();
-}
-
std::string TestTCPSocketPrivate::TestConnectAddress() {
PP_NetAddress_Private address;
@@ -160,6 +128,8 @@ std::string TestTCPSocketPrivate::TestConnectAddress() {
PASS();
}
+// TODO(viettrungluu): Try testing SSL somehow.
+
int32_t TestTCPSocketPrivate::ReadFirstLineFromSocket(
pp::TCPSocketPrivate* socket,
std::string* s) {
diff --git a/ppapi/tests/test_tcp_socket_private.h b/ppapi/tests/test_tcp_socket_private.h
index 4c31853..4c18a62 100644
--- a/ppapi/tests/test_tcp_socket_private.h
+++ b/ppapi/tests/test_tcp_socket_private.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,7 +25,6 @@ class TestTCPSocketPrivate : public TestCase {
private:
std::string TestBasic();
std::string TestReadWrite();
- std::string TestReadWriteSSL();
std::string TestConnectAddress();
int32_t ReadFirstLineFromSocket(pp::TCPSocketPrivate* socket, std::string* s);
@@ -34,7 +33,6 @@ class TestTCPSocketPrivate : public TestCase {
std::string host_;
uint16_t port_;
- uint16_t ssl_port_;
};
#endif // PAPPI_TESTS_TEST_TCP_SOCKET_PRIVATE_H_
diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc
index f19292f..4ef5152 100644
--- a/ppapi/tests/testing_instance.cc
+++ b/ppapi/tests/testing_instance.cc
@@ -31,7 +31,6 @@ TestingInstance::TestingInstance(PP_Instance instance)
current_case_(NULL),
executed_tests_(false),
nacl_mode_(false),
- ssl_server_port_(-1),
websocket_port_(-1) {
callback_factory_.Initialize(this);
}
@@ -52,8 +51,6 @@ bool TestingInstance::Init(uint32_t argc,
protocol_ = argv[i];
} else if (std::strcmp(argn[i], "websocket_port") == 0) {
websocket_port_ = atoi(argv[i]);
- } else if (std::strcmp(argn[i], "ssl_server_port") == 0) {
- ssl_server_port_ = atoi(argv[i]);
}
}
// Create the proper test case from the argument.
diff --git a/ppapi/tests/testing_instance.h b/ppapi/tests/testing_instance.h
index b5a6333..c064329 100644
--- a/ppapi/tests/testing_instance.h
+++ b/ppapi/tests/testing_instance.h
@@ -82,8 +82,6 @@ pp::InstancePrivate {
return protocol_;
}
- int ssl_server_port() { return ssl_server_port_; }
-
int websocket_port() { return websocket_port_; }
// Posts a message to the test page to eval() the script.
@@ -151,9 +149,6 @@ pp::InstancePrivate {
// with http.
std::string protocol_;
- // SSL server port.
- int ssl_server_port_;
-
// WebSocket port.
int websocket_port_;
};