Skip to content

Commit

Permalink
cobalt: Reenable cobalt_unitests on non-Android (e.g. Linux) (#4925)
Browse files Browse the repository at this point in the history
These tests were disabled because they failed to compile on  
e.g. Linux (b/375243230). But we need them enabled otherwise  
we cannot add more Cobalt unittests, e.g. in #4916.

This CL reenables those and leaves NOTIMPLEMENTED()s+TODO()s  
where appropriate.

Bug: b/374213479
  • Loading branch information
yell0wd0g authored Feb 19, 2025
1 parent f19998d commit c633b62
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
29 changes: 28 additions & 1 deletion base/system/sys_info_starboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

#if BUILDFLAG(IS_ANDROID)
#include <sys/system_properties.h>
#else
// TODO(b/374213479): Remove after the functions below are implemented.
#include "base/notreached.h"
#endif // BUILDFLAG(IS_ANDROID)

namespace base {
Expand Down Expand Up @@ -61,7 +64,31 @@ std::string SbSysInfo::Brand() {
__system_property_get("ro.product.brand", brand_str);
return std::string(brand_str);
}
#else
std::string SbSysInfo::OriginalDesignManufacturer() {
// TODO(b/374213479): Implement for non-Android.
NOTIMPLEMENTED();
return "";
}

std::string SbSysInfo::ChipsetModelNumber() {
// TODO(b/374213479): Implement for non-Android.
NOTIMPLEMENTED();
return "";
}

std::string SbSysInfo::ModelYear() {
// TODO(b/374213479): Implement for non-Android.
NOTIMPLEMENTED();
return "";
}

std::string SbSysInfo::Brand() {
// TODO(b/374213479): Implement for non-Android.
NOTIMPLEMENTED();
return "";
}
#endif // BUILDFLAG(IS_ANDROID)

} // namespace starboard
} // namespace base
} // namespace base
22 changes: 10 additions & 12 deletions cobalt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,16 @@ action("cobalt_build_info") {
]
}

if (is_android) {
test("cobalt_unittests") {
testonly = true
test("cobalt_unittests") {
testonly = true

sources = [ "//cobalt/user_agent/user_agent_platform_info_test.cc" ]
sources = [ "//cobalt/user_agent/user_agent_platform_info_test.cc" ]

deps = [
"//base/test:run_all_unittests",
"//cobalt/user_agent",
"//starboard:starboard_group",
"//testing/gmock",
"//testing/gtest",
]
}
deps = [
"//base/test:run_all_unittests",
"//cobalt/user_agent",
"//starboard:starboard_group",
"//testing/gmock",
"//testing/gtest",
]
}
2 changes: 2 additions & 0 deletions cobalt/build/testing/targets/linux-x64x11/test_targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"base:base_unittests",
"cc:cc_perftests",
"cc:cc_unittests",
"cobalt:cobalt_unittests",
"components/viz:viz_perftests",
"components/viz:viz_unittests",
"crypto:crypto_unittests",
Expand Down Expand Up @@ -36,6 +37,7 @@
"out/linux-x64x11_devel/base_unittests",
"out/linux-x64x11_devel/cc_perftests",
"out/linux-x64x11_devel/cc_unittests",
"out/linux-x64x11_devel/cobalt_unittests",
"out/linux-x64x11_devel/viz_perftests",
"out/linux-x64x11_devel/viz_unittests",
"out/linux-x64x11_devel/crypto_unittests",
Expand Down

0 comments on commit c633b62

Please sign in to comment.