The SigninInteractionControllerTestCase testSignInCancelAddAccount triggers the disappearance of the presented view controller, but in a way that does not set 'isBeingDismissed' to true.
Here is the stack trace of the SettingsNavigationController being dismissed, but without the isBeingDismissed property being set to true:
#0 0x00000001036778e2 in ::-[SettingsNavigationController viewWillDisappear:](BOOL) at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/chrome/browser/ui/settings/settings_navigation_controller.mm:344
#1 0x000000010effc2b9 in -[UIViewController _setViewAppearState:isAnimating:] ()
#2 0x000000010effcb4d in -[UIViewController __viewWillDisappear:] ()
#3 0x000000010efc7256 in __56-[UIPresentationController runTransitionForCurrentState]_block_invoke ()
#4 0x000000010ee59d59 in _runAfterCACommitDeferredBlocks ()
#5 0x000000010ee48bb1 in _cleanUpAfterCAFlushAndRunDeferredBlocks ()
#6 0x000000010ee780e0 in _afterCACommitHandler ()
#7 0x000000011108ac07 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#8 0x000000011108ab5e in __CFRunLoopDoObservers ()
#9 0x000000011106f124 in __CFRunLoopRun ()
#10 0x000000011106e889 in CFRunLoopRunSpecific ()
#11 0x00000001146dfde6 in -[GREYRunLoopSpinner grey_drainRunLoopInActiveModeForDrains:] at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/third_party/earl_grey/src/EarlGrey/Synchronization/GREYRunLoopSpinner.m:103
#12 0x00000001146dfb98 in -[GREYRunLoopSpinner spinWithStopConditionBlock:] at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/third_party/earl_grey/src/EarlGrey/Synchronization/GREYRunLoopSpinner.m:52
#13 0x00000001146e3401 in -[GREYUIThreadExecutor executeSyncWithTimeout:block:error:] at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/third_party/earl_grey/src/EarlGrey/Synchronization/GREYUIThreadExecutor.m:227
#14 0x00000001146b59f7 in -[GREYElementInteraction performAction:error:] at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/third_party/earl_grey/src/EarlGrey/Core/GREYElementInteraction.m:289
#15 0x00000001146b52df in -[GREYElementInteraction performAction:] at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/third_party/earl_grey/src/EarlGrey/Core/GREYElementInteraction.m:201
#16 0x00000001042ee59e in ::+[ChromeEarlGreyUI openToolsMenu]() at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm:54
#17 0x00000001042ee78b in ::+[ChromeEarlGreyUI openSettingsMenu]() at /Users/peterlaurens/Source/bling/src/out/Debug-iphonesimulator/../../ios/chrome/test/earl_grey/chrome_earl_grey_ui.mm:66
The test opens a new about:blank URL which is what is causing the view controller to be dismissed. However it's not clear why under EarlGrey the isBeingDismissed property is not true, but under manual testing it is.
Comment 1 by peterlaurens@chromium.org
, Jan 18 2018