Chromium Code Reviews
DescriptionFix ios_chrome_unittests to crash on DCHECK failure.
In CollectionViewModelTest.InvalidIndexPath, the global assert logger
was overridden to ignore assertion but never restored to the default
value, causing all subsequent DCHECK failures to be ignored.
This CL fixes this incorrect behaviour by restoring the global assert
logger at the end of the test execution and by fixing all the tests
that were silently broken.
List of individual test fixes:
- introduce an helper class to wait for the PersonalDataManager async
tasks to complete and use it in autofill tests interacting with the
PersonalDataManager (without the wait, the SQL database is closed
while some operations are pending and they fails with NOTREACHED()
when they finally get scheduled)
- remove individual registration of a SingleThreadTaskRunner with the
metrics system as there is no way to unregister the task runner once
it is set and instead register one globally in IOSChromeUnitTestSuite
- add a function to reset the global hidden startup attemp count as the
CrashLoopDetectionUtilTest.FullCycle test expect the hidden value to
be uninitialised which is not the case (as some test do initialise it
as a side-effect of creating the AppState)
- register a local state with the TestingApplicationContext as production
code exercised by PrivacyCollectionViewControllerTest.TestModel test
expect to register preference listener on the local state
BUG=650811
Committed: https://crrev.com/37302ec073c605e19030b0d58a0bd0b6a30d0434
Cr-Commit-Position: refs/heads/master@{#440413}
Patch Set 1 #Patch Set 2 : Rebase on https://codereview.chromium.org/2591823003/ as it fix some DCHECKs. #
Total comments: 2
Patch Set 3 : Rebase #
Total comments: 8
Patch Set 4 : Address comments #Messages
Total messages: 32 (22 generated)
|