Split out from large CL. PTAL, Hidehiko-san
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
: user_session_manager_(as you're resetting this in TearDown(), could you set it up in SetUp() to keep the consistency?
// Destroy UserSessionManager after SessionManager (inside TearDown) to| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
: user_session_manager_(as you're resetting this in TearDown(), could you set it up in SetUp() to keep the consistency?
The problem is that AshTestHelper also creates a SessionManager if one doesn't exist (NoSessionAshTestBase::SetUp() calls AshTestBase::SetUp(), which instantiates AshTestHelper), so we have to do this early. I can add a comment here to explain this unless there's some other way to approach this.
// Destroy UserSessionManager after SessionManager (inside TearDown) toditto
https://chromium-review.git.corp.google.com/c/chromium/src/+/8027383/comment/3b0c24bb_60acb22a/
This is the problem:
https://source.chromium.org/chromium/chromium/src/+/main:ash/test/ash_test_helper.cc;l=132-137
So AshTestHelper can touch the sessionmanager, so we should destroy the user_session_manager_ last. (I've updated the comment to be more clear).
We don't have to do it this way because the internal session_manager unique pointer in AshTestHelper is set to null so it should not be a problem.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
: user_session_manager_(Achuith Bhandarkaras you're resetting this in TearDown(), could you set it up in SetUp() to keep the consistency?
The problem is that AshTestHelper also creates a SessionManager if one doesn't exist (NoSessionAshTestBase::SetUp() calls AshTestBase::SetUp(), which instantiates AshTestHelper), so we have to do this early. I can add a comment here to explain this unless there's some other way to approach this.
Also, you can still put the initialization statement in SetUp() of this class, but still earlier than NoSessionAShTestBase::SetUp().
// Destroy UserSessionManager after SessionManager (inside TearDown) toAchuith Bhandarkarditto
https://chromium-review.git.corp.google.com/c/chromium/src/+/8027383/comment/3b0c24bb_60acb22a/
This is the problem:
https://source.chromium.org/chromium/chromium/src/+/main:ash/test/ash_test_helper.cc;l=132-137So AshTestHelper can touch the sessionmanager, so we should destroy the user_session_manager_ last. (I've updated the comment to be more clear).
We don't have to do it this way because the internal session_manager unique pointer in AshTestHelper is set to null so it should not be a problem.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
: user_session_manager_(Achuith Bhandarkaras you're resetting this in TearDown(), could you set it up in SetUp() to keep the consistency?
Hidehiko AbeThe problem is that AshTestHelper also creates a SessionManager if one doesn't exist (NoSessionAshTestBase::SetUp() calls AshTestBase::SetUp(), which instantiates AshTestHelper), so we have to do this early. I can add a comment here to explain this unless there's some other way to approach this.
Also, you can still put the initialization statement in SetUp() of this class, but still earlier than NoSessionAShTestBase::SetUp().
Done
FakeRmadClientForTest::Initialize();DBUS services should be initialized first
user_session_manager_.reset();This should be in reverse order.
// Destroy UserSessionManager after SessionManager (inside TearDown) toAchuith Bhandarkarditto
https://chromium-review.git.corp.google.com/c/chromium/src/+/8027383/comment/3b0c24bb_60acb22a/
Hidehiko AbeThis is the problem:
https://source.chromium.org/chromium/chromium/src/+/main:ash/test/ash_test_helper.cc;l=132-137So AshTestHelper can touch the sessionmanager, so we should destroy the user_session_manager_ last. (I've updated the comment to be more clear).
We don't have to do it this way because the internal session_manager unique pointer in AshTestHelper is set to null so it should not be a problem.
PTAL: https://chromium-review.git.corp.google.com/c/chromium/src/+/8027383/comment/edda6be9_536b41a6/
Ok, I have tried to initialize services in SetUp to match prod, and destruct in reverse order in TearDown.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
shimless_rma: Use TestUserSessionManager
Replaces FakeUserManager and ScopedUserManager with
TestUserSessionManager to manage user sessions in
ShimlessRmaServiceTest.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |