Commit 731c9854 authored by bzanotti's avatar bzanotti Committed by Commit bot

Fix AccountInfo uninitialized memory issues.

AccountInfo constructor now correctly initializes all its members.
Re-enable the affected tests under MSan.

BUG=577333

Review URL: https://codereview.chromium.org/1588913002

Cr-Commit-Position: refs/heads/master@{#369419}
parent c458c18b
...@@ -21,7 +21,16 @@ bool UpdateField(bool* field, bool new_value) { ...@@ -21,7 +21,16 @@ bool UpdateField(bool* field, bool new_value) {
} }
} }
AccountInfo::AccountInfo() {} AccountInfo::AccountInfo()
: account_id(),
gaia(),
email(),
full_name(),
given_name(),
hosted_domain(),
locale(),
picture_url(),
is_child_account(false) {}
AccountInfo::~AccountInfo() {} AccountInfo::~AccountInfo() {}
bool AccountInfo::IsValid() const { bool AccountInfo::IsValid() const {
......
...@@ -57,13 +57,7 @@ TEST_F(AccountInfoTest, UpdateWithNoModification) { ...@@ -57,13 +57,7 @@ TEST_F(AccountInfoTest, UpdateWithNoModification) {
} }
// Tests that UpdateWith() correctly updates its fields that were not set. // Tests that UpdateWith() correctly updates its fields that were not set.
// Fails under MSan. crbug.com/577333 TEST_F(AccountInfoTest, UpdateWithSuccessfulUpdate) {
#if defined(MEMORY_SANITIZER)
#define MAYBE_UpdateWithSuccessfulUpdate DISABLED_UpdateWithSuccessfulUpdate
#else
#define MAYBE_UpdateWithSuccessfulUpdate UpdateWithSuccessfulUpdate
#endif
TEST_F(AccountInfoTest, MAYBE_UpdateWithSuccessfulUpdate) {
AccountInfo info; AccountInfo info;
info.account_id = info.gaia = info.email = "test_id"; info.account_id = info.gaia = info.email = "test_id";
......
...@@ -665,13 +665,7 @@ TEST_F(AccountTrackerServiceTest, SeedAccountInfo) { ...@@ -665,13 +665,7 @@ TEST_F(AccountTrackerServiceTest, SeedAccountInfo) {
EXPECT_EQ(email, infos[0].email); EXPECT_EQ(email, infos[0].email);
} }
// Fails under MSan. crbug.com/577333 TEST_F(AccountTrackerServiceTest, SeedAccountInfoFull) {
#if defined(MEMORY_SANITIZER)
#define MAYBE_SeedAccountInfoFull DISABLED_SeedAccountInfoFull
#else
#define MAYBE_SeedAccountInfoFull SeedAccountInfoFull
#endif
TEST_F(AccountTrackerServiceTest, MAYBE_SeedAccountInfoFull) {
AccountTrackerObserver observer; AccountTrackerObserver observer;
account_tracker()->AddObserver(&observer); account_tracker()->AddObserver(&observer);
......
...@@ -3394,15 +3394,3 @@ ...@@ -3394,15 +3394,3 @@
fun:_ZN2cc10GLRenderer18DrawRenderPassQuadEPNS_14DirectRenderer12DrawingFrameEPKNS_18RenderPassDrawQuadEPKN3gfx5QuadFE fun:_ZN2cc10GLRenderer18DrawRenderPassQuadEPNS_14DirectRenderer12DrawingFrameEPKNS_18RenderPassDrawQuadEPKN3gfx5QuadFE
fun:_ZN2cc10GLRenderer10DoDrawQuadEPNS_14DirectRenderer12DrawingFrameEPKNS_8DrawQuadEPKN3gfx5QuadFE fun:_ZN2cc10GLRenderer10DoDrawQuadEPNS_14DirectRenderer12DrawingFrameEPKNS_8DrawQuadEPKN3gfx5QuadFE
} }
{
bug_577333a
Memcheck:Uninitialized
...
fun:_ZN47AccountInfoTest_UpdateWithSuccessfulUpdate_Test8TestBodyEv
}
{
bug_577333b
Memcheck:Uninitialized
...
fun:_ZN50AccountTrackerServiceTest_SeedAccountInfoFull_Test8TestBodyEv
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment