Bug 1592444 - Allow E_ACCESSDENIED from CoAllowSetForegroundWindow in debug build. r=aklotz

Bug 1588500 reported some of Thunderbird's tests failed because
`CoAllowSetForegroundWindow` failed.  In that case, those tests should not launch
a default browser of the system, but we should allow `E_ACCESSDENIED` because
it legitimately happens if the window is not in the foreground.

Differential Revision: https://phabricator.services.mozilla.com/D52618

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Toshihito Kikuchi 2019-11-12 19:36:50 +00:00
Родитель d7d35f9904
Коммит 948a64f4c1
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -126,10 +126,11 @@ inline LauncherVoidResult ShellExecuteByExplorer(const _bstr_t& aPath,
}
// Passing the foreground privilege so that the shell can launch an
// application in the foreground. If CoAllowSetForegroundWindow fails,
// we continue because it's not fatal.
// application in the foreground. This fails with E_ACCESSDENIED if the
// current window is shown in the background. We keep a soft assert for
// the other failures to investigate how it happened.
hr = ::CoAllowSetForegroundWindow(shellDisp, nullptr);
MOZ_ASSERT(SUCCEEDED(hr));
MOZ_ASSERT(SUCCEEDED(hr) || hr == E_ACCESSDENIED);
// shellapi.h macros interfere with the correct naming of the method being
// called on IShellDispatch2. Temporarily remove that definition.