Bug 1681936 - Skip mXULLoadDurationMS check in GTest. r=mhowell

In GTest, xul.dll is considered untrusted because only the `FirefoxDirectory`
flag of `ModuleTrustFlags` is turned on.  In CCov build, however, xul.dll is
considered trusted because the `FirefoxDirectoryAndVersion` flag is also turned
on.  In the former case, the `FirefoxDirectoryAndVersion` is not turned on
because when xul.dll is re-built for GTest, its version becomes newer than
firefox.exe.  In the CCov build, the version of firefox.exe was also reset
probaly during instrumentation.  As a result, the loding event contains a value
in `mXULLoadDurationMS` in CCov build, but normally not.

This fix removes the check for `mXULLoadDurationMS` in GTest.

Differential Revision: https://phabricator.services.mozilla.com/D99564
This commit is contained in:
Toshihito Kikuchi 2020-12-12 00:09:43 +00:00
Родитель 428d1105f4
Коммит a354021b5a
1 изменённых файлов: 2 добавлений и 3 удалений

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

@ -151,11 +151,10 @@ static void ValidateUntrustedModules(const UntrustedModulesData& aData) {
EXPECT_FALSE(evt.mIsDependent); EXPECT_FALSE(evt.mIsDependent);
} }
// No check for the mXULLoadDurationMS field because the field has a value
// in CCov build GTest, but it is empty in non-CCov build (bug 1681936).
EXPECT_GT(aData.mEvents.length(), 0); EXPECT_GT(aData.mEvents.length(), 0);
EXPECT_GT(aData.mStacks.GetModuleCount(), 0); EXPECT_GT(aData.mStacks.GetModuleCount(), 0);
// Because xul.dll is not signed when running GTest,
// mXULLoadDurationMS is expected to be empty.
EXPECT_TRUE(aData.mXULLoadDurationMS.isNothing());
EXPECT_EQ(aData.mSanitizationFailures, 0); EXPECT_EQ(aData.mSanitizationFailures, 0);
EXPECT_EQ(aData.mTrustTestFailures, 0); EXPECT_EQ(aData.mTrustTestFailures, 0);
} }