| Index: third_party/grpc/src/ruby/spec/spec_helper.rb
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py b/third_party/grpc/src/ruby/spec/spec_helper.rb
|
| similarity index 54%
|
| copy from third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py
|
| copy to third_party/grpc/src/ruby/spec/spec_helper.rb
|
| index 429f58186e3fce43dc21e81e0f9d7e20c7e0bf70..c891c1bf5e45e32eaab4df10c094ef1bdc20bea1 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/websocket/workers/resources/echo_wsh.py
|
| +++ b/third_party/grpc/src/ruby/spec/spec_helper.rb
|
| @@ -1,4 +1,4 @@
|
| -# Copyright 2010, Google Inc.
|
| +# Copyright 2015, Google Inc.
|
| # All rights reserved.
|
| #
|
| # Redistribution and use in source and binary forms, with or without
|
| @@ -27,20 +27,43 @@
|
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| +spec_dir = File.expand_path(File.dirname(__FILE__))
|
| +root_dir = File.expand_path(File.join(spec_dir, '..'))
|
| +lib_dir = File.expand_path(File.join(root_dir, 'lib'))
|
|
|
| -from mod_pywebsocket import msgutil
|
| +$LOAD_PATH.unshift(spec_dir)
|
| +$LOAD_PATH.unshift(lib_dir)
|
| +$LOAD_PATH.uniq!
|
|
|
| +# set up coverage
|
| +require 'simplecov'
|
| +SimpleCov.start do
|
| + add_filter 'spec'
|
| + add_filter 'bin'
|
| + SimpleCov.command_name ENV['COVERAGE_NAME']
|
| +end if ENV['COVERAGE_NAME']
|
|
|
| -_GOODBYE_MESSAGE = 'Goodbye'
|
| +require 'rspec'
|
| +require 'logging'
|
| +require 'rspec/logging_helper'
|
|
|
| +# GRPC is the general RPC module
|
| +#
|
| +# Configure its logging for fine-grained log control during test runs
|
| +module GRPC
|
| + extend Logging.globally
|
| +end
|
| +Logging.logger.root.appenders = Logging.appenders.stdout
|
| +Logging.logger.root.level = :info
|
| +Logging.logger['GRPC'].level = :info
|
| +Logging.logger['GRPC::ActiveCall'].level = :info
|
| +Logging.logger['GRPC::BidiCall'].level = :info
|
|
|
| -def web_socket_do_extra_handshake(request):
|
| - pass # Always accept.
|
| -
|
| +# Configure RSpec to capture log messages for each test. The output from the
|
| +# logs will be stored in the @log_output variable. It is a StringIO instance.
|
| +RSpec.configure do |config|
|
| + include RSpec::LoggingHelper
|
| + config.capture_log_messages # comment this out to see logs during test runs
|
| +end
|
|
|
| -def web_socket_transfer_data(request):
|
| - while True:
|
| - line = msgutil.receive_message(request)
|
| - msgutil.send_message(request, line)
|
| - if line == _GOODBYE_MESSAGE:
|
| - return
|
| +RSpec::Expectations.configuration.warn_about_potential_false_positives = false
|
|
|