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

Side by Side Diff: net/data/websocket/echo_wsh.py

Issue 11087027: WebSocket test server migration on ExtensionApiTest.WebSocket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 8 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 | Annotate | Revision Log
OLDNEW
1 #!/bin/sh -x 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # 2 #
3 # Protocol Buffers - Google's data interchange format
4 # Copyright 2009 Google Inc. All rights reserved.
5 # http://code.google.com/p/protobuf/
6 #
7 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
9 # met: 5 # met:
10 # 6 #
11 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
14 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
15 # in the documentation and/or other materials provided with the 11 # in the documentation and/or other materials provided with the
16 # distribution. 12 # distribution.
17 # * Neither the name of Google Inc. nor the names of its 13 # * Neither the name of Google Inc. nor the names of its
18 # contributors may be used to endorse or promote products derived from 14 # contributors may be used to endorse or promote products derived from
19 # this software without specific prior written permission. 15 # this software without specific prior written permission.
20 # 16 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #
33 # Author: brianolson@google.com (Brian Olson)
34 #
35 # Test compatibility between command line gzip/gunzip binaries and
36 # ZeroCopyStream versions.
37 28
38 TESTFILE=Makefile
39 29
40 (./zcgzip < ${TESTFILE} | gunzip | cmp - ${TESTFILE}) && \ 30 _GOODBYE_MESSAGE = u'Goodbye'
41 (gzip < ${TESTFILE} | ./zcgunzip | cmp - ${TESTFILE})
42 31
43 # Result of "(cmd) && (cmd)" implicitly becomes result of this script 32
44 # and thus the test. 33 def web_socket_do_extra_handshake(request):
34 pass # Always accept.
35
36
37 def web_socket_transfer_data(request):
38 while True:
39 line = request.ws_stream.receive_message()
40 if line is None:
41 return
42 if isinstance(line, unicode):
43 request.ws_stream.send_message(line, binary=False)
44 if line == _GOODBYE_MESSAGE:
45 return
46 else:
47 request.ws_stream.send_message(line, binary=True)
Ryan Sleevi 2012/10/09 19:39:07 nit: I'm never sure what the prevailing wind for C
Takashi Toyoshima 2012/10/10 01:34:48 Oops. I forgot that Chromium style was different f
48
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698