From f4bcf2a6efc3dc59e4a71a02cc3e0fdd17d48fca Mon Sep 17 00:00:00 2001 From: Shawn Quereshi Date: Mon, 7 Aug 2023 16:02:44 -0700 Subject: [PATCH] Run pre-commits for `cast_starboard_api_changes`. Bug: n/a Test: n/a --- starboard/BUILD.gn | 5 +-- .../build/config/starboard_target_type.gni | 2 +- starboard/contrib/cast/README.md | 4 +-- .../cast/cast_starboard_api/samples/BUILD.gn | 22 +++++-------- .../samples/cast_starboard_api_test.cc | 31 ++++++++++--------- starboard/shared/x11/application_x11.cc | 2 +- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/starboard/BUILD.gn b/starboard/BUILD.gn index 84e56cacbd73..9856e430070b 100644 --- a/starboard/BUILD.gn +++ b/starboard/BUILD.gn @@ -24,13 +24,13 @@ group("gn_all") { "//starboard/client_porting/eztime:eztime_test", "//starboard/client_porting/icu_init", "//starboard/client_porting/poem:poem_unittests", + "//starboard/contrib/cast/cast_starboard_api/samples:cast", "//starboard/examples/hello_world:starboard_hello_world_example", "//starboard/examples/window:starboard_window_example", "//starboard/extension:extension_test", "//starboard/loader_app:app_key_files_test", "//starboard/nplb", "//starboard/nplb/nplb_evergreen_compat_tests", - "//starboard/contrib/cast/cast_starboard_api/samples:cast" ] if (gl_type != "none") { @@ -179,7 +179,8 @@ source_set("starboard_headers_only") { if (current_toolchain == starboard_toolchain) { # This is the default 'starboard_platform_target'; use default properties - starboard_platform_target("starboard_platform_group") {} + starboard_platform_target("starboard_platform_group") { + } if (platform_tests_path == "") { # If 'starboard_platform_tests' is not defined by the platform, then an diff --git a/starboard/build/config/starboard_target_type.gni b/starboard/build/config/starboard_target_type.gni index 33e2666ba27c..1823fbe1df62 100644 --- a/starboard/build/config/starboard_target_type.gni +++ b/starboard/build/config/starboard_target_type.gni @@ -49,4 +49,4 @@ template("starboard_platform_target") { public_deps += invoker.public_deps } } -} \ No newline at end of file +} diff --git a/starboard/contrib/cast/README.md b/starboard/contrib/cast/README.md index 1d81dfd39bf6..780b542f306b 100644 --- a/starboard/contrib/cast/README.md +++ b/starboard/contrib/cast/README.md @@ -1,7 +1,7 @@ ## Cast Starboard API The Cast Starboard API is a shared library which contains the portion of -Starboard required to run Cast. +Starboard required to run Cast. ### Customizations @@ -45,7 +45,7 @@ ninja -C out/linux-x64x11_devel/ cast_starboard_api_test To run the test suite: ``` -./out/linux-x64x11_devel/cast_starboard_api_test_loader +./out/linux-x64x11_devel/cast_starboard_api_test_loader ``` ### Known Issues diff --git a/starboard/contrib/cast/cast_starboard_api/samples/BUILD.gn b/starboard/contrib/cast/cast_starboard_api/samples/BUILD.gn index 810a3a2b7e99..b24f612d8328 100644 --- a/starboard/contrib/cast/cast_starboard_api/samples/BUILD.gn +++ b/starboard/contrib/cast/cast_starboard_api/samples/BUILD.gn @@ -3,9 +3,7 @@ import("//starboard/build/config/starboard_target_type.gni") group("cast") { if (build_with_separate_cobalt_toolchain) { - public_deps = [ - ":cast_starboard_api($starboard_toolchain)" - ] + public_deps = [ ":cast_starboard_api($starboard_toolchain)" ] } } @@ -14,8 +12,8 @@ if (build_with_separate_cobalt_toolchain) { starboard_platform_target("cast_starboard_api") { ldflags = [ # Hide unwanted symbols, which also shrinks the resulting binary. - "-Wl,--version-script=" + rebase_path("./cast_starboard_api.lds", - root_build_dir) + "-Wl,--version-script=" + + rebase_path("./cast_starboard_api.lds", root_build_dir), ] if (!use_asan) { @@ -29,14 +27,12 @@ if (build_with_separate_cobalt_toolchain) { copy("cast_starboard_api_test_data") { install_content = true - sources = ["$root_out_dir/libcast_starboard_api.so"] + sources = [ "$root_out_dir/libcast_starboard_api.so" ] # This artifact is consumed by a test built outside of the # starboard_toolchain; move from `starboard/content/` to `content/`. outputs = [ "$sb_static_contents_output_data_dir/../../content/{{source_file_part}}" ] - deps = [ - ":cast_starboard_api" - ] + deps = [ ":cast_starboard_api" ] } } target(gtest_target_type, "cast_starboard_api_test") { @@ -45,13 +41,11 @@ if (build_with_separate_cobalt_toolchain) { "//starboard/common/test_main.cc", "cast_starboard_api_test.cc", ] - data_deps = [ - ":cast_starboard_api_test_data($starboard_toolchain)", - ] + data_deps = [ ":cast_starboard_api_test_data($starboard_toolchain)" ] deps = [ "//starboard", - "//testing/gtest", "//starboard/nplb/testdata/file_tests:nplb_file_tests_data", + "//testing/gtest", ] } -} \ No newline at end of file +} diff --git a/starboard/contrib/cast/cast_starboard_api/samples/cast_starboard_api_test.cc b/starboard/contrib/cast/cast_starboard_api/samples/cast_starboard_api_test.cc index 06c312c671b1..8fcf18ca5842 100644 --- a/starboard/contrib/cast/cast_starboard_api/samples/cast_starboard_api_test.cc +++ b/starboard/contrib/cast/cast_starboard_api/samples/cast_starboard_api_test.cc @@ -5,6 +5,7 @@ #include "starboard/common/condition_variable.h" #include "starboard/common/log.h" #include "starboard/common/mutex.h" +#include "starboard/common/thread.h" #include "starboard/egl.h" #include "starboard/event.h" #include "starboard/file.h" @@ -12,7 +13,6 @@ #include "starboard/system.h" #include "starboard/window.h" #include "testing/gtest/include/gtest/gtest.h" -#include "starboard/common/thread.h" namespace { @@ -51,12 +51,13 @@ class CastStarboardApiTest : public ::testing::Test { private: class CastStarboardApiThread : public starboard::Thread { - public: - CastStarboardApiThread(CastStarboardApi* api) : starboard::Thread("cast_thread"), api_(api) {} + public: + explicit CastStarboardApiThread(CastStarboardApi* api) + : starboard::Thread("cast_thread"), api_(api) {} void Run() override; - private: + private: CastStarboardApi* api_; }; @@ -100,8 +101,10 @@ void EventCallbackStatic(void* context) { CastStarboardApiTest::CastStarboardApiTest() { g_test_instance = this; - started_cond_ = std::make_unique(started_mutex_); - received_cond_ = std::make_unique(received_mutex_); + started_cond_ = + std::make_unique(started_mutex_); + received_cond_ = + std::make_unique(received_mutex_); // Ensure libcast_starboard_api.so has been opened. if (!g_lib) { @@ -145,11 +148,11 @@ CastStarboardApiTest::~CastStarboardApiTest() { void CastStarboardApiTest::EventHandleInternal(const SbEvent* event) { switch (event->type) { - case kSbEventTypeStart: - started_cond_->Signal(); - break; - default: - break; + case kSbEventTypeStart: + started_cond_->Signal(); + break; + default: + break; } received_.push_back(event->type); @@ -165,8 +168,8 @@ void CastStarboardApiTest::WaitForEventCallback() { received_mutex_.Release(); } -void CastStarboardApiTest::CastStarboardApiThread::Run() { - api_->SbRunStarboardMain(0, nullptr, &EventHandleStatic); +void CastStarboardApiTest::CastStarboardApiThread::Run() { + api_->SbRunStarboardMain(0, nullptr, &EventHandleStatic); } // The default Application only be started once in the lifetime of the @@ -265,4 +268,4 @@ TEST_F(CastStarboardApiTest, EventLoop_CastWindowSurface) { api().SbWindowDestroy(window); } -} // namespace \ No newline at end of file +} // namespace diff --git a/starboard/shared/x11/application_x11.cc b/starboard/shared/x11/application_x11.cc index 067d3ddb7446..7efa1031a144 100644 --- a/starboard/shared/x11/application_x11.cc +++ b/starboard/shared/x11/application_x11.cc @@ -920,7 +920,7 @@ ApplicationX11::WaitForSystemEventWithTimeout(SbTime time) { } // In modular builds, |CreateWindow| is not always called before the event - // loop is running. + // loop is running. if (!dev_input_) { return nullptr; }