Commit c5cf88e6 authored by Misha Efimov's avatar Misha Efimov Committed by Commit Bot

[Cronet] Make cronet_[unit]tests run on Mac OS X.

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I10071ce60082dc66a4b63c57fe7ad53f51ccdac3
Bug: 812268
Reviewed-on: https://chromium-review.googlesource.com/985056Reviewed-by: default avatarWez <wez@chromium.org>
Commit-Queue: Misha Efimov <mef@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548173}
parent 62502ea5
...@@ -70,6 +70,17 @@ source_set("cronet_common_unittests") { ...@@ -70,6 +70,17 @@ source_set("cronet_common_unittests") {
# a cronet_tests binary that exercises it, and a unit-tests binary. # a cronet_tests binary that exercises it, and a unit-tests binary.
# Android and iOS have their own platform-specific rules to build Cronet. # Android and iOS have their own platform-specific rules to build Cronet.
if (!is_ios && !is_android) { if (!is_ios && !is_android) {
config("shared_library_public_config") {
if (is_mac && !is_component_build) {
# Executable targets that depend on the shared libraries below need to have
# the rpath setup in non-component build configurations.
ldflags = [
"-rpath",
"@executable_path/",
]
}
}
shared_library("cronet") { shared_library("cronet") {
deps = [ deps = [
"//base", "//base",
...@@ -85,6 +96,14 @@ if (!is_ios && !is_android) { ...@@ -85,6 +96,14 @@ if (!is_ios && !is_android) {
sources = [ sources = [
"cronet_global_state_stubs.cc", "cronet_global_state_stubs.cc",
] ]
if (is_mac && !is_component_build) {
ldflags = [
"-install_name",
"@rpath/lib${target_name}.dylib",
]
public_configs = [ ":shared_library_public_config" ]
}
} }
test("cronet_tests") { test("cronet_tests") {
......
...@@ -21,6 +21,8 @@ namespace { ...@@ -21,6 +21,8 @@ namespace {
scoped_refptr<base::SingleThreadTaskRunner> InitializeAndCreateTaskRunner() { scoped_refptr<base::SingleThreadTaskRunner> InitializeAndCreateTaskRunner() {
// TODO(wez): Remove this once AtExitManager dependencies are gone. // TODO(wez): Remove this once AtExitManager dependencies are gone.
// This fails cronet_test in component builds, which are not supported.
// See https://crbug.com/816705.
ignore_result(new base::AtExitManager); ignore_result(new base::AtExitManager);
url::Initialize(); url::Initialize();
......
...@@ -379,9 +379,9 @@ TEST_F(StaleHostResolverTest, CancelWithStaleCache) { ...@@ -379,9 +379,9 @@ TEST_F(StaleHostResolverTest, CancelWithStaleCache) {
// CancelWithFreshCache makes no sense; the request would've returned // CancelWithFreshCache makes no sense; the request would've returned
// synchronously. // synchronously.
// Limited expired time cases are flaky under iOS (crbug.com/792173). // Limited expired time cases are flaky under iOS and MACOS (crbug.com/792173).
// Disallow other networks cases fail under Fuchsia (crbug.com/816143). // Disallow other networks cases fail under Fuchsia (crbug.com/816143).
#if defined(OS_IOS) || defined(OS_FUCHSIA) #if defined(OS_IOS) || defined(OS_FUCHSIA) || defined(OS_MACOSX)
#define MAYBE_StaleUsability DISABLED_StaleUsability #define MAYBE_StaleUsability DISABLED_StaleUsability
#else #else
#define MAYBE_StaleUsability StaleUsability #define MAYBE_StaleUsability StaleUsability
......
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