| # 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. |
| |
| config("webdriver_all_dependent_config") { |
| defines = [ "ENABLE_WEBDRIVER" ] |
| } |
| |
| static_library("webdriver") { |
| configs -= [ "//starboard/build/config:size" ] |
| configs += [ "//starboard/build/config:speed" ] |
| |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//cobalt/base", |
| "//cobalt/cssom", |
| "//cobalt/dom", |
| "//cobalt/loader", |
| "//cobalt/math", |
| "//cobalt/script", |
| "//net", |
| "//net:http_server", |
| "//third_party/icu:icuuc", |
| "//url", |
| ] |
| if (is_gold) { |
| sources = [ "stub_web_driver_module.cc" ] |
| } else { |
| sources = [ |
| "algorithms.cc", |
| "algorithms.h", |
| "dispatcher.cc", |
| "dispatcher.h", |
| "element_driver.cc", |
| "element_driver.h", |
| "keyboard.cc", |
| "keyboard.h", |
| "protocol/button.cc", |
| "protocol/button.h", |
| "protocol/capabilities.cc", |
| "protocol/capabilities.h", |
| "protocol/cookie.cc", |
| "protocol/cookie.h", |
| "protocol/element_id.cc", |
| "protocol/element_id.h", |
| "protocol/frame_id.cc", |
| "protocol/frame_id.h", |
| "protocol/keys.cc", |
| "protocol/keys.h", |
| "protocol/location.cc", |
| "protocol/location.h", |
| "protocol/log_entry.cc", |
| "protocol/log_entry.h", |
| "protocol/log_type.cc", |
| "protocol/log_type.h", |
| "protocol/moveto.cc", |
| "protocol/moveto.h", |
| "protocol/proxy.cc", |
| "protocol/proxy.h", |
| "protocol/rect.cc", |
| "protocol/rect.h", |
| "protocol/response.cc", |
| "protocol/response.h", |
| "protocol/script.cc", |
| "protocol/script.h", |
| "protocol/search_strategy.cc", |
| "protocol/search_strategy.h", |
| "protocol/server_status.cc", |
| "protocol/server_status.h", |
| "protocol/session_id.h", |
| "protocol/size.cc", |
| "protocol/size.h", |
| "protocol/window_id.cc", |
| "protocol/window_id.h", |
| "screencast/screencast_module.cc", |
| "screencast/screencast_module.h", |
| "screenshot.cc", |
| "screenshot.h", |
| "script_executor.cc", |
| "script_executor.h", |
| "script_executor_params.cc", |
| "script_executor_params.h", |
| "script_executor_result.h", |
| "search.cc", |
| "search.h", |
| "server.cc", |
| "server.h", |
| "session_driver.cc", |
| "session_driver.h", |
| "web_driver_module.cc", |
| "web_driver_module.h", |
| "window_driver.cc", |
| "window_driver.h", |
| ] |
| deps += [ ":copy_webdriver_data" ] |
| all_dependent_configs = [ ":webdriver_all_dependent_config" ] |
| } |
| } |
| |
| copy("copy_webdriver_data") { |
| install_content = true |
| sources = [ "content/webdriver-init.js" ] |
| outputs = |
| [ "$sb_static_contents_output_data_dir/webdriver/webdriver-init.js" ] |
| } |
| |
| copy("webdriver_copy_test_data") { |
| install_content = true |
| sources = [ |
| "testdata/displayed_test.html", |
| "testdata/map.png", |
| "testdata/simple_test.py", |
| ] |
| |
| outputs = [ "$sb_static_contents_output_data_dir/test/cobalt/webdriver_test/{{source_file_part}}" ] |
| } |
| |
| target(gtest_target_type, "webdriver_test") { |
| testonly = true |
| |
| sources = [ |
| "execute_test.cc", |
| "get_element_text_test.cc", |
| "is_displayed_test.cc", |
| "keyboard_test.cc", |
| ] |
| |
| deps = [ |
| ":webdriver", |
| "//cobalt/base", |
| "//cobalt/browser", |
| "//cobalt/css_parser:css_parser", |
| "//cobalt/cssom:cssom", |
| "//cobalt/dom/testing:dom_testing", |
| "//cobalt/script", |
| "//cobalt/test:run_all_unittests", |
| "//cobalt/web/testing:web_testing", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//third_party/devtools:devtools_all_files", |
| ] |
| |
| data_deps = [ |
| ":copy_webdriver_data", |
| ":webdriver_copy_test_data", |
| ] |
| } |