| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_channel.h" | 5 #include "net/websockets/websocket_channel.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
| 31 #include "net/base/test_completion_callback.h" | 31 #include "net/base/test_completion_callback.h" |
| 32 #include "net/http/http_response_headers.h" | 32 #include "net/http/http_response_headers.h" |
| 33 #include "net/log/net_log_with_source.h" | 33 #include "net/log/net_log_with_source.h" |
| 34 #include "net/url_request/url_request_context.h" | 34 #include "net/url_request/url_request_context.h" |
| 35 #include "net/websockets/websocket_errors.h" | 35 #include "net/websockets/websocket_errors.h" |
| 36 #include "net/websockets/websocket_event_interface.h" | 36 #include "net/websockets/websocket_event_interface.h" |
| 37 #include "net/websockets/websocket_handshake_request_info.h" | 37 #include "net/websockets/websocket_handshake_request_info.h" |
| 38 #include "net/websockets/websocket_handshake_response_info.h" | 38 #include "net/websockets/websocket_handshake_response_info.h" |
| 39 #include "net/websockets/websocket_handshake_stream_create_helper.h" | 39 #include "net/websockets/websocket_handshake_stream_create_helper.h" |
| 40 #include "net/websockets/websocket_mux.h" | |
| 41 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
| 42 #include "testing/gtest/include/gtest/gtest.h" | 41 #include "testing/gtest/include/gtest/gtest.h" |
| 43 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 44 #include "url/origin.h" | 43 #include "url/origin.h" |
| 45 | 44 |
| 46 // Hacky macros to construct the body of a Close message from a code and a | 45 // Hacky macros to construct the body of a Close message from a code and a |
| 47 // string, while ensuring the result is a compile-time constant string. | 46 // string, while ensuring the result is a compile-time constant string. |
| 48 // Use like CLOSE_DATA(NORMAL_CLOSURE, "Explanation String") | 47 // Use like CLOSE_DATA(NORMAL_CLOSURE, "Explanation String") |
| 49 #define CLOSE_DATA(code, string) WEBSOCKET_CLOSE_CODE_AS_STRING_##code string | 48 #define CLOSE_DATA(code, string) WEBSOCKET_CLOSE_CODE_AS_STRING_##code string |
| 50 #define WEBSOCKET_CLOSE_CODE_AS_STRING_NORMAL_CLOSURE "\x03\xe8" | 49 #define WEBSOCKET_CLOSE_CODE_AS_STRING_NORMAL_CLOSURE "\x03\xe8" |
| (...skipping 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3527 channel_->SendFrame( | 3526 channel_->SendFrame( |
| 3528 true, WebSocketFrameHeader::kOpCodeText, | 3527 true, WebSocketFrameHeader::kOpCodeText, |
| 3529 AsIOBuffer(std::string(static_cast<size_t>(kMessageSize), 'a')), | 3528 AsIOBuffer(std::string(static_cast<size_t>(kMessageSize), 'a')), |
| 3530 static_cast<size_t>(kMessageSize)); | 3529 static_cast<size_t>(kMessageSize)); |
| 3531 int new_send_quota = channel_->current_send_quota(); | 3530 int new_send_quota = channel_->current_send_quota(); |
| 3532 EXPECT_EQ(kMessageSize, initial_send_quota - new_send_quota); | 3531 EXPECT_EQ(kMessageSize, initial_send_quota - new_send_quota); |
| 3533 } | 3532 } |
| 3534 | 3533 |
| 3535 } // namespace | 3534 } // namespace |
| 3536 } // namespace net | 3535 } // namespace net |
| OLD | NEW |