OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/websockets/websocket_job.h" | 5 #include "net/websockets/websocket_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "testing/platform_test.h" | 34 #include "testing/platform_test.h" |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
38 class MockSocketStream : public net::SocketStream { | 38 class MockSocketStream : public net::SocketStream { |
39 public: | 39 public: |
40 MockSocketStream(const GURL& url, net::SocketStream::Delegate* delegate) | 40 MockSocketStream(const GURL& url, net::SocketStream::Delegate* delegate) |
41 : SocketStream(url, delegate) {} | 41 : SocketStream(url, delegate) {} |
42 virtual ~MockSocketStream() {} | 42 virtual ~MockSocketStream() {} |
43 | 43 |
44 virtual void Connect() {} | 44 virtual void Connect() OVERRIDE {} |
45 virtual bool SendData(const char* data, int len) { | 45 virtual bool SendData(const char* data, int len) OVERRIDE { |
46 sent_data_ += std::string(data, len); | 46 sent_data_ += std::string(data, len); |
47 return true; | 47 return true; |
48 } | 48 } |
49 | 49 |
50 virtual void Close() {} | 50 virtual void Close() OVERRIDE {} |
51 virtual void RestartWithAuth( | 51 virtual void RestartWithAuth( |
52 const string16& username, const string16& password) {} | 52 const net::AuthCredentials& credentials) OVERRIDE { |
53 virtual void DetachDelegate() { | 53 } |
| 54 |
| 55 virtual void DetachDelegate() OVERRIDE { |
54 delegate_ = NULL; | 56 delegate_ = NULL; |
55 } | 57 } |
56 | 58 |
57 const std::string& sent_data() const { | 59 const std::string& sent_data() const { |
58 return sent_data_; | 60 return sent_data_; |
59 } | 61 } |
60 | 62 |
61 private: | 63 private: |
62 std::string sent_data_; | 64 std::string sent_data_; |
63 }; | 65 }; |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 | 1079 |
1078 TEST_F(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { | 1080 TEST_F(WebSocketJobTest, ThrottlingSpdySpdyEnabled) { |
1079 WebSocketJob::set_websocket_over_spdy_enabled(true); | 1081 WebSocketJob::set_websocket_over_spdy_enabled(true); |
1080 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); | 1082 TestConnectBySpdy(SPDY_ON, THROTTLING_ON); |
1081 } | 1083 } |
1082 | 1084 |
1083 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. | 1085 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. |
1084 // TODO(toyoshim,yutak): Add tests to verify closing handshake. | 1086 // TODO(toyoshim,yutak): Add tests to verify closing handshake. |
1085 | 1087 |
1086 } // namespace net | 1088 } // namespace net |
OLD | NEW |