| Index: webrtc/base/proxy_unittest.cc
|
| diff --git a/webrtc/base/proxy_unittest.cc b/webrtc/base/proxy_unittest.cc
|
| index 4dba0dd8f34be4c62c843e53d3963e7008741fed..5c5a7489f7724d2995c263adf1a2e12ed44cb1cd 100644
|
| --- a/webrtc/base/proxy_unittest.cc
|
| +++ b/webrtc/base/proxy_unittest.cc
|
| @@ -10,7 +10,6 @@
|
|
|
| #include <memory>
|
| #include <string>
|
| -#include "webrtc/base/autodetectproxy.h"
|
| #include "webrtc/base/gunit.h"
|
| #include "webrtc/base/httpserver.h"
|
| #include "webrtc/base/proxyserver.h"
|
| @@ -29,18 +28,6 @@ static const SocketAddress kHttpsProxyIntAddr("1.2.3.4", 443);
|
| static const SocketAddress kHttpsProxyExtAddr("1.2.3.5", 0);
|
| static const SocketAddress kBogusProxyIntAddr("1.2.3.4", 999);
|
|
|
| -// Used to run a proxy detect on the current thread. Otherwise we would need
|
| -// to make both threads share the same VirtualSocketServer.
|
| -class AutoDetectProxyRunner : public rtc::AutoDetectProxy {
|
| - public:
|
| - explicit AutoDetectProxyRunner(const std::string& agent)
|
| - : AutoDetectProxy(agent) {}
|
| - void Run() {
|
| - DoWork();
|
| - Thread::Current()->Restart(); // needed to reset the messagequeue
|
| - }
|
| -};
|
| -
|
| // Sets up a virtual socket server and HTTPS/SOCKS5 proxy servers.
|
| class ProxyTest : public testing::Test {
|
| public:
|
| @@ -57,16 +44,6 @@ class ProxyTest : public testing::Test {
|
|
|
| rtc::SocketServer* ss() { return ss_.get(); }
|
|
|
| - rtc::ProxyType DetectProxyType(const SocketAddress& address) {
|
| - rtc::ProxyType type;
|
| - AutoDetectProxyRunner* detect = new AutoDetectProxyRunner("unittest/1.0");
|
| - detect->set_proxy(address);
|
| - detect->Run(); // blocks until done
|
| - type = detect->proxy().type;
|
| - detect->Destroy(false);
|
| - return type;
|
| - }
|
| -
|
| private:
|
| std::unique_ptr<rtc::SocketServer> ss_;
|
| std::unique_ptr<rtc::SocksProxyServer> socks_;
|
| @@ -99,38 +76,3 @@ TEST_F(ProxyTest, TestSocks5Connect) {
|
| EXPECT_TRUE(client.CheckNextPacket("foo", 3, NULL));
|
| EXPECT_TRUE(client.CheckNoPacket());
|
| }
|
| -
|
| -/*
|
| -// Tests whether we can use a HTTPS proxy to connect to a server.
|
| -TEST_F(ProxyTest, TestHttpsConnect) {
|
| - AsyncSocket* socket = ss()->CreateAsyncSocket(SOCK_STREAM);
|
| - AsyncHttpsProxySocket* proxy_socket = new AsyncHttpsProxySocket(
|
| - socket, "unittest/1.0", kHttpsProxyIntAddress, "", CryptString());
|
| - TestClient client(new AsyncTCPSocket(proxy_socket));
|
| - TestEchoServer server(Thread::Current(), SocketAddress());
|
| -
|
| - EXPECT_TRUE(client.Connect(server.address()));
|
| - EXPECT_TRUE(client.CheckConnected());
|
| - EXPECT_EQ(server.address(), client.remote_address());
|
| - client.Send("foo", 3);
|
| - EXPECT_TRUE(client.CheckNextPacket("foo", 3, NULL));
|
| - EXPECT_TRUE(client.CheckNoPacket());
|
| -}
|
| -*/
|
| -
|
| -// Tests whether we can autodetect a SOCKS5 proxy.
|
| -TEST_F(ProxyTest, TestAutoDetectSocks5) {
|
| - EXPECT_EQ(rtc::PROXY_SOCKS5, DetectProxyType(kSocksProxyIntAddr));
|
| -}
|
| -
|
| -/*
|
| -// Tests whether we can autodetect a HTTPS proxy.
|
| -TEST_F(ProxyTest, TestAutoDetectHttps) {
|
| - EXPECT_EQ(rtc::PROXY_HTTPS, DetectProxyType(kHttpsProxyIntAddr));
|
| -}
|
| -*/
|
| -
|
| -// Tests whether we fail properly for no proxy.
|
| -TEST_F(ProxyTest, TestAutoDetectBogus) {
|
| - EXPECT_EQ(rtc::PROXY_UNKNOWN, DetectProxyType(kBogusProxyIntAddr));
|
| -}
|
|
|