| # Copyright 2021 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| static_library("websocket") { |
| has_pedantic_warnings = true |
| |
| sources = [ |
| "buffered_amount_tracker.cc", |
| "buffered_amount_tracker.h", |
| "close_event.h", |
| "cobalt_web_socket_event_handler.cc", |
| "cobalt_web_socket_event_handler.h", |
| "sec_web_socket_key.h", |
| "web_socket.cc", |
| "web_socket.h", |
| "web_socket_impl.cc", |
| "web_socket_impl.h", |
| ] |
| deps = [ |
| "//cobalt/base", |
| "//cobalt/browser:generated_type_conversion", |
| "//cobalt/dom", |
| "//cobalt/dom:dom_exception", |
| "//cobalt/network", |
| "//cobalt/script", |
| "//net", |
| "//starboard", |
| "//third_party/protobuf:protobuf_lite", |
| "//url", |
| ] |
| } |
| |
| target(gtest_target_type, "websocket_test") { |
| testonly = true |
| has_pedantic_warnings = true |
| sources = [ |
| "mock_websocket_channel.cc", |
| "web_socket_impl_test.cc", |
| "web_socket_test.cc", |
| ] |
| deps = [ |
| ":websocket", |
| "//cobalt/base", |
| "//cobalt/dom", |
| "//cobalt/dom:dom_exception", |
| "//cobalt/network", |
| "//cobalt/script", |
| "//cobalt/test:run_all_unittests", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//url", |
| |
| # TODO: Remove the dependency below, it works around the fact that |
| # ScriptValueFactory has non-virtual method CreatePromise(). |
| "//cobalt/script:engine", |
| ] |
| |
| if (!is_gold) { |
| deps += [ "//cobalt/debug" ] |
| } |
| } |