Commit e9ff0fe3 authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

Fuchsia: miscellaneous fixes to make content_unittests buildable.

* Disable POSIX signalling from BrowserTestBase for Fuchsia
  (not compatible).
* Switch EXPECT_DEATH tests to EXPECT_DEATH_IF_SUPPORTED for
  TestBrowserThreadBundleTest.
* Add fuchsia to the list of supported platforms in
  fieldtrial_to_struct.py.
* Move webrtc deps into "enable_webrtc" conditional block.


Bug: 754861, 756269
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2cce36ca3cebfeb0acf86ad0c2cf0cd0f8645f51
Reviewed-on: https://chromium-review.googlesource.com/619727
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarAlexei Svitkine (very slow) <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496498}
parent c960f94b
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
namespace content { namespace content {
namespace { namespace {
#if defined(OS_POSIX) #if defined(OS_POSIX) && !defined(OS_FUCHSIA)
// On SIGSEGV or SIGTERM (sent by the runner on timeouts), dump a stack trace // On SIGSEGV or SIGTERM (sent by the runner on timeouts), dump a stack trace
// (to make debugging easier) and also exit with a known error code (so that // (to make debugging easier) and also exit with a known error code (so that
// the test framework considers this a failure -- http://crbug.com/57578). // the test framework considers this a failure -- http://crbug.com/57578).
...@@ -81,7 +81,7 @@ void DumpStackTraceSignalHandler(int signal) { ...@@ -81,7 +81,7 @@ void DumpStackTraceSignalHandler(int signal) {
} }
_exit(128 + signal); _exit(128 + signal);
} }
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX) && !defined(OS_FUCHSIA)
void RunTaskOnRendererThread(const base::Closure& task, void RunTaskOnRendererThread(const base::Closure& task,
const base::Closure& quit_task) { const base::Closure& quit_task) {
...@@ -277,13 +277,13 @@ void BrowserTestBase::TearDown() { ...@@ -277,13 +277,13 @@ void BrowserTestBase::TearDown() {
} }
void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
#if defined(OS_POSIX) #if defined(OS_POSIX) && !defined(OS_FUCHSIA)
g_browser_process_pid = base::GetCurrentProcId(); g_browser_process_pid = base::GetCurrentProcId();
signal(SIGSEGV, DumpStackTraceSignalHandler); signal(SIGSEGV, DumpStackTraceSignalHandler);
if (handle_sigterm_) if (handle_sigterm_)
signal(SIGTERM, DumpStackTraceSignalHandler); signal(SIGTERM, DumpStackTraceSignalHandler);
#endif // defined(OS_POSIX) #endif // defined(OS_POSIX) && !defined(OS_FUCHSIA)
if (base::CommandLine::ForCurrentProcess()->HasSwitch( if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableTracing)) { switches::kEnableTracing)) {
......
...@@ -44,7 +44,8 @@ TEST(TestBrowserThreadBundleTest, ...@@ -44,7 +44,8 @@ TEST(TestBrowserThreadBundleTest,
TEST(TestBrowserThreadBundleTest, MessageLoopTypeMismatch) { TEST(TestBrowserThreadBundleTest, MessageLoopTypeMismatch) {
base::MessageLoopForUI message_loop; base::MessageLoopForUI message_loop;
EXPECT_DEATH(
EXPECT_DEATH_IF_SUPPORTED(
{ {
TestBrowserThreadBundle test_browser_thread_bundle( TestBrowserThreadBundle test_browser_thread_bundle(
TestBrowserThreadBundle::IO_MAINLOOP); TestBrowserThreadBundle::IO_MAINLOOP);
...@@ -53,7 +54,7 @@ TEST(TestBrowserThreadBundleTest, MessageLoopTypeMismatch) { ...@@ -53,7 +54,7 @@ TEST(TestBrowserThreadBundleTest, MessageLoopTypeMismatch) {
} }
TEST(TestBrowserThreadBundleTest, MultipleTestBrowserThreadBundle) { TEST(TestBrowserThreadBundleTest, MultipleTestBrowserThreadBundle) {
EXPECT_DEATH( EXPECT_DEATH_IF_SUPPORTED(
{ {
TestBrowserThreadBundle test_browser_thread_bundle; TestBrowserThreadBundle test_browser_thread_bundle;
TestBrowserThreadBundle other_test_browser_thread_bundle; TestBrowserThreadBundle other_test_browser_thread_bundle;
......
...@@ -1629,7 +1629,6 @@ test("content_unittests") { ...@@ -1629,7 +1629,6 @@ test("content_unittests") {
"//third_party/icu", "//third_party/icu",
"//third_party/leveldatabase", "//third_party/leveldatabase",
"//third_party/re2", "//third_party/re2",
"//third_party/webrtc_overrides",
"//third_party/widevine/cdm:headers", "//third_party/widevine/cdm:headers",
"//ui/accessibility", "//ui/accessibility",
"//ui/base:test_support", "//ui/base:test_support",
...@@ -1653,7 +1652,7 @@ test("content_unittests") { ...@@ -1653,7 +1652,7 @@ test("content_unittests") {
"//third_party/mesa:osmesa", "//third_party/mesa:osmesa",
] ]
if (is_posix) { if (is_posix && !is_fuchsia) {
sources += [ "../browser/posix_file_descriptor_info_impl_unittest.cc" ] sources += [ "../browser/posix_file_descriptor_info_impl_unittest.cc" ]
} }
...@@ -1758,6 +1757,7 @@ test("content_unittests") { ...@@ -1758,6 +1757,7 @@ test("content_unittests") {
"//third_party/webrtc/modules/video_capture", "//third_party/webrtc/modules/video_capture",
"//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/rtc_base:rtc_base",
"//third_party/webrtc/stats:rtc_stats_test_utils", "//third_party/webrtc/stats:rtc_stats_test_utils",
"//third_party/webrtc_overrides",
"//third_party/webrtc_overrides:init_webrtc", "//third_party/webrtc_overrides:init_webrtc",
"//ui/shell_dialogs:shell_dialogs", "//ui/shell_dialogs:shell_dialogs",
] ]
......
...@@ -116,7 +116,8 @@ def main(arguments): ...@@ -116,7 +116,8 @@ def main(arguments):
if not opts.platform: if not opts.platform:
parser.error('You must specify a --platform.') parser.error('You must specify a --platform.')
supported_platforms = ['android', 'chromeos', 'ios', 'linux', 'mac', 'win'] supported_platforms = ['android', 'chromeos', 'fuchsia', 'ios', 'linux',
'mac', 'win']
if opts.platform not in supported_platforms: if opts.platform not in supported_platforms:
parser.error('\'%s\' is an unknown platform. Supported platforms: %s' % parser.error('\'%s\' is an unknown platform. Supported platforms: %s' %
(opts.platform, supported_platforms)) (opts.platform, supported_platforms))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment