[Mac] Media tests start to time out after a few days of bot uptime
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2015 22:36:09 +0000 (22:36 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Sep 2015 22:36:09 +0000 (22:36 +0000)
commit05ebec3c25558072d19dc0670d069848528844bf
treeb11d476ef0f44c722527261c70e463207a00eb08
parent6ec42d713bcf7c8b9206ec68bc61367a36c666ab
[Mac] Media tests start to time out after a few days of bot uptime
https://bugs.webkit.org/show_bug.cgi?id=149468

Reviewed by Darin Adler.

Source/WebKit2:

Make the fix work with WebKit2, and avoid touching user's media cache for WebKit1.

When UI process is not sandboxed, inherit DIRHELPER_USER_DIR_SUFFIX from it.
This means that during testing, WebContent uses a temporary directory of the form
/private/var/folders/.../T/WebKitTestRunner-VKjmz0/com.apple.WebKit.WebContent.Development,
instead of /private/var/folders/.../T/com.apple.WebKit.WebContent.Development+WebKitTestRunner.

WebKit1 now also better respects a temporary directory of the form
/private/var/folders/.../T/DumpRenderTree-VKjmz0, instead of the default, which
makes CoreMedia put its cache inside it.

As a result, almost everything is isolated per testing process, and deleted at the end.
Same with cache directories. The only outliers that I know of are plug-in directories,
which are per-process, but are not under the testing root, and thus aren't deleted.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeSandbox):
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::fromConnection):
(WebKit::ChildProcessProxy::getLaunchOptions):
(WebKit::ChildProcessProxy::connect):
* Shared/ChildProcessProxy.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* Shared/SandboxInitializationParameters.h:
(WebKit::SandboxInitializationParameters::sandboxProfile):
(WebKit::SandboxInitializationParameters::setUserDirectorySuffix):
(WebKit::SandboxInitializationParameters::userDirectorySuffix):
(WebKit::SandboxInitializationParameters::setSystemDirectorySuffix): Deleted.
(WebKit::SandboxInitializationParameters::systemDirectorySuffix): Deleted.
* Shared/ios/ChildProcessIOS.mm:
(WebKit::ChildProcess::initializeSandbox):
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::initializeSandbox):
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getLaunchOptions):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):

Tools:

Delete cache directory in addition to the temporary one. Don't delete /private/tmp/MediaCache,
as it's not longer used by tests. Set TMPDIR and DIRHELPER_USER_DIR_SUFFIX to make
all temporary and cache files go to a custom location.

* Scripts/webkitpy/port/base.py:
* Scripts/webkitpy/port/driver.py:
* Scripts/webkitpy/port/mac.py:
* Scripts/webkitpy/port/win.py:
(WinPort._driver_tempdir_for_environment): Deleted unused function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit2/Shared/ChildProcessProxy.cpp
Source/WebKit2/Shared/ChildProcessProxy.h
Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm
Source/WebKit2/Shared/SandboxInitializationParameters.h
Source/WebKit2/Shared/ios/ChildProcessIOS.mm
Source/WebKit2/Shared/mac/ChildProcessMac.mm
Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Tools/ChangeLog
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/driver.py
Tools/Scripts/webkitpy/port/mac.py
Tools/Scripts/webkitpy/port/win.py