Chrome Version : 53.0.2774.3
OS Version: OS X 10.11.5
In gyp, it has one here: https://chromium.googlesource.com/chromium/src/+/1ce26dc83bff3f79f27b698f9cddeb7d9470949a/content/content_tests.gypi#1051
But in GN, in only depends on //content/common:mojo_bindings: https://chromium.googlesource.com/chromium/src/+/1ce26dc83bff3f79f27b698f9cddeb7d9470949a/content/test/BUILD.gn#657
Without it, innocuous changes can break the component build. Eg: https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/211243 (cl: https://codereview.chromium.org/2091213002/#ps120001 ) gets:
[18246/18288] LINK content_unittests.exe
FAILED: content_unittests.exe
E:/b/depot_tools/python276_bin/python.exe gyp-win-tool link-wrapper environment.x86 False link.exe /nologo /OUT:content_unittests.exe /PDB:content_unittests.exe.pdb @content_unittests.exe.rsp
event_with_latency_info_unittest.obj :error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall content::EventWithLatencyInfo<class blink::WebGestureEvent>::EventWithLatencyInfo<class blink::WebGestureEvent>(class content::EventWithLatencyInfo<class blink::WebGestureEvent> &&)" (__imp_??0?$EventWithLatencyInfo@VWebGestureEvent@blink@@@content@@QAE@$$QAV01@@Z) referenced in function "protected: class content::EventWithLatencyInfo<class blink::WebGestureEvent> __thiscall content::`anonymous namespace'::EventWithLatencyInfoTest::CreateGestureEvent(enum blink::WebInputEvent::Type,double)" (?CreateGestureEvent@EventWithLatencyInfoTest@?A0x58bef626@content@@IAE?AV?$EventWithLatencyInfo@VWebGestureEvent@blink@@@3@W4Type@WebInputEvent@blink@@N@Z)
event_with_latency_info_unittest.obj :error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall content::EventWithLatencyInfo<class blink::WebMouseWheelEven>...
event_with_latency_info_unittest.obj :error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall content::EventWithLatencyInfo<class blink::WebMouseEvent>...
event_with_latency_info_unittest.obj :error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall content::EventWithLatencyInfo<class blink::WebTouchEvent>...
content_unittests.exe : fatalerror LNK1120: 4 unresolved externals
(note this _only_ happens on win_chromium_compile_dbg_ng)
But! Just adding it causes a spew of other problems. E.g. https://codereview.chromium.org/2102443002/#ps1 has failures on most bots. One [of many...] looks like:
FAILED: content_unittests
Undefined symbols for architecture x86_64:
"_IOSurfaceLookup", referenced from:
content::Sandbox::SandboxWarmup(int) in sandbox_mac.o
"content::GetContentClient()", referenced from:
(anonymous namespace)::LoadCursor(int, int, int) in webcursor_mac.o
content::TrialTokenValidator::ValidateToken(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, url::Origin const&, base::BasicStringPiece<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >) in trial_token_validator.o
content::(anonymous namespace)::SchemeAndOriginWhitelist::Reset() in origin_util.o
content::ComputePepperPluginList(std::__1::vector<content::PepperPluginInfo, std::__1::allocator<content::PepperPluginInfo> >*) in pepper_plugin_list.o
content::GetProcessTypeNameInEnglish(int) in process_type.o
content::LoadSandboxTemplate(int) in sandbox_mac.o
content::SiteIsolationPolicy::AreCrossProcessFramesPossible() in site_isolation_policy.o
...
"switches::kUtilityProcessAllowedDir", referenced from:
content::GetSandboxTypeFromCommandLine(int*, base::FilePath*) in sandbox_init_mac.o
GetSandboxTypeFromCommandLine() in sandbox_init_mac.cc can probably be given internal linkage. That doesn't change things. But the problem for the last error actually seems to be that `kUtilityProcessAllowedDir[];` isn't declared CONTENT_EXPORT, even though it's referenced in content/browser/utility_process_host_impl.cc.
Same thing for content::GetcontentClient()
_IOSurfaceLookup is fixed by adding libs += IOSurface.framework
Comment 1 by tapted@chromium.org
, Jun 28 2016