• Evan Stade's avatar
    Modify shutdown sequence of NotificationDisplayServiceTester. · 7a379f73
    Evan Stade authored
    This is a more general fix for the CFI issues seen while updating tests
    to use NotificationDisplayServiceTester. While referencing |profile_|
    after shutdown would typically be sorta safe in this case, the CFI bot
    objects because it detects a cast on a destroyed object.
    
    The old solution, administered somewhat inconsistently, was to destroy
    the NotificationDisplayServiceTester before the profile. However this
    also has issues, because some code references the
    NotificationDisplayService during profile shutdown. Hence it is not
    safe for NDSTester to outlive its profile, and not safe not to outlive
    its profile.
    
    The solution is to allow it to outlive its profile but not reference
    the profile after it's been destroyed.
    
    TBR=rdevlin.cronin@chromium.org,atwilson@chromium.org
    
    Bug: 804231
    Change-Id: I17f29befb18f0667b2f15ca2bb7554af1854b6d1
    Reviewed-on: https://chromium-review.googlesource.com/883224Reviewed-by: default avatarEvan Stade <estade@chromium.org>
    Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
    Commit-Queue: Evan Stade <estade@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#531950}
    7a379f73
notification_display_service_tester.h 3.72 KB