| # 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("xhr") { |
| has_pedantic_warnings = true |
| sources = [ |
| "url_fetcher_buffer_writer.cc", |
| "url_fetcher_buffer_writer.h", |
| "xml_http_request.cc", |
| "xml_http_request.h", |
| "xml_http_request_event_target.cc", |
| "xml_http_request_event_target.h", |
| ] |
| |
| deps = [ |
| "//cobalt/base", |
| "//cobalt/dom", |
| "//cobalt/dom:dom_exception", |
| "//cobalt/dom_parser", |
| "//cobalt/loader", |
| "//cobalt/script", |
| "//nb", |
| "//net", |
| "//starboard", |
| "//third_party/protobuf:protobuf_lite", |
| "//url", |
| ] |
| |
| if (enable_xhr_header_filtering && !sb_is_evergreen) { |
| sources = [ "xhr_modify_headers.h" ] |
| defines = [ "COBALT_ENABLE_XHR_HEADER_FILTERING" ] |
| deps += [ cobalt_platform_dependencies ] |
| } |
| } |
| |
| target(gtest_target_type, "xhr_test") { |
| testonly = true |
| has_pedantic_warnings = true |
| sources = [ "xml_http_request_test.cc" ] |
| deps = [ |
| ":xhr", |
| "//cobalt/base", |
| "//cobalt/dom", |
| "//cobalt/dom:dom_exception", |
| "//cobalt/test:run_all_unittests", |
| "//testing/gmock", |
| "//testing/gtest", |
| |
| # TODO: Remove the dependency below, it works around the fact that |
| # ScriptValueFactory has non-virtual method CreatePromise(). |
| "//cobalt/script:engine", |
| ] |
| } |