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

Side by Side Diff: net/websockets/websocket_end_to_end_test.cc

Issue 2267233002: Change WebSocketChannel to pass data via IOBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make it const char* Created 4 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 unified diff | Download patch
« no previous file with comments | « net/websockets/websocket_channel_test.cc ('k') | net/websockets/websocket_event_interface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // End-to-end tests for WebSocket. 5 // End-to-end tests for WebSocket.
6 // 6 //
7 // A python server is (re)started for each test, which is moderately 7 // A python server is (re)started for each test, which is moderately
8 // inefficient. However, it makes these tests a good fit for scenarios which 8 // inefficient. However, it makes these tests a good fit for scenarios which
9 // require special server configurations. 9 // require special server configurations.
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 std::string selected_subprotocol() const; 64 std::string selected_subprotocol() const;
65 65
66 std::string extensions() const; 66 std::string extensions() const;
67 67
68 // Implementation of WebSocketEventInterface. 68 // Implementation of WebSocketEventInterface.
69 ChannelState OnAddChannelResponse(const std::string& selected_subprotocol, 69 ChannelState OnAddChannelResponse(const std::string& selected_subprotocol,
70 const std::string& extensions) override; 70 const std::string& extensions) override;
71 71
72 ChannelState OnDataFrame(bool fin, 72 ChannelState OnDataFrame(bool fin,
73 WebSocketMessageType type, 73 WebSocketMessageType type,
74 const std::vector<char>& data) override; 74 scoped_refptr<IOBuffer> data,
75 size_t data_size) override;
75 76
76 ChannelState OnFlowControl(int64_t quota) override; 77 ChannelState OnFlowControl(int64_t quota) override;
77 78
78 ChannelState OnClosingHandshake() override; 79 ChannelState OnClosingHandshake() override;
79 80
80 ChannelState OnDropChannel(bool was_clean, 81 ChannelState OnDropChannel(bool was_clean,
81 uint16_t code, 82 uint16_t code,
82 const std::string& reason) override; 83 const std::string& reason) override;
83 84
84 ChannelState OnFailChannel(const std::string& message) override; 85 ChannelState OnFailChannel(const std::string& message) override;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const std::string& extensions) { 136 const std::string& extensions) {
136 selected_subprotocol_ = selected_subprotocol; 137 selected_subprotocol_ = selected_subprotocol;
137 extensions_ = extensions; 138 extensions_ = extensions;
138 QuitNestedEventLoop(); 139 QuitNestedEventLoop();
139 return CHANNEL_ALIVE; 140 return CHANNEL_ALIVE;
140 } 141 }
141 142
142 ChannelState ConnectTestingEventInterface::OnDataFrame( 143 ChannelState ConnectTestingEventInterface::OnDataFrame(
143 bool fin, 144 bool fin,
144 WebSocketMessageType type, 145 WebSocketMessageType type,
145 const std::vector<char>& data) { 146 scoped_refptr<IOBuffer> data,
147 size_t data_size) {
146 return CHANNEL_ALIVE; 148 return CHANNEL_ALIVE;
147 } 149 }
148 150
149 ChannelState ConnectTestingEventInterface::OnFlowControl(int64_t quota) { 151 ChannelState ConnectTestingEventInterface::OnFlowControl(int64_t quota) {
150 return CHANNEL_ALIVE; 152 return CHANNEL_ALIVE;
151 } 153 }
152 154
153 ChannelState ConnectTestingEventInterface::OnClosingHandshake() { 155 ChannelState ConnectTestingEventInterface::OnClosingHandshake() {
154 return CHANNEL_ALIVE; 156 return CHANNEL_ALIVE;
155 } 157 }
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 GURL ws_url = ws_server.GetURL("header-continuation"); 519 GURL ws_url = ws_server.GetURL("header-continuation");
518 520
519 EXPECT_TRUE(ConnectAndWait(ws_url)); 521 EXPECT_TRUE(ConnectAndWait(ws_url));
520 EXPECT_EQ("permessage-deflate; server_max_window_bits=10", 522 EXPECT_EQ("permessage-deflate; server_max_window_bits=10",
521 event_interface_->extensions()); 523 event_interface_->extensions());
522 } 524 }
523 525
524 } // namespace 526 } // namespace
525 527
526 } // namespace net 528 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_channel_test.cc ('k') | net/websockets/websocket_event_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698