Commit ad417088 authored by John Z Wu's avatar John Z Wu Committed by Commit Bot

Re-enable test in CWVSyncControllerTest

Bug: 1048231
Change-Id: I34eaf7227400136fea1bfc70f7d5c48fa8498bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2048287
Commit-Queue: John Wu <jzw@chromium.org>
Reviewed-by: default avatarHiroshi Ichikawa <ichikawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741150}
parent 9c04214e
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#import "base/test/ios/wait_util.h"
#include "components/autofill/core/browser/test_personal_data_manager.h" #include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/password_manager/core/browser/mock_password_store.h" #include "components/password_manager/core/browser/mock_password_store.h"
...@@ -63,6 +64,9 @@ const char kTestPassphrase[] = "dummy-passphrase"; ...@@ -63,6 +64,9 @@ const char kTestPassphrase[] = "dummy-passphrase";
const char kTestScope1[] = "scope1.chromium.org"; const char kTestScope1[] = "scope1.chromium.org";
const char kTestScope2[] = "scope2.chromium.org"; const char kTestScope2[] = "scope2.chromium.org";
using base::test::ios::kWaitForActionTimeout;
using base::test::ios::WaitUntilConditionOrTimeout;
std::unique_ptr<KeyedService> BuildMockSyncService(web::BrowserState* context) { std::unique_ptr<KeyedService> BuildMockSyncService(web::BrowserState* context) {
return std::make_unique<syncer::MockSyncService>(); return std::make_unique<syncer::MockSyncService>();
} }
...@@ -198,12 +202,16 @@ TEST_F(CWVSyncControllerTest, DelegateCallbacks) { ...@@ -198,12 +202,16 @@ TEST_F(CWVSyncControllerTest, DelegateCallbacks) {
identity_manager(), identity_manager()->GetPrimaryAccountId(), identity_manager(), identity_manager()->GetPrimaryAccountId(),
auth_error); auth_error);
// TODO(crbug.com/1048231): Re-enable after updating mocks. [[delegate expect] syncControllerDidStopSync:sync_controller_];
// [[delegate expect] syncControllerDidStopSync:sync_controller_]; EXPECT_CALL(*mock_sync_service(), StopAndClear());
// identity_manager()->GetPrimaryAccountMutator()->ClearPrimaryAccount( EXPECT_CALL(*password_store_, RemoveLoginsCreatedBetweenImpl);
// signin::PrimaryAccountMutator::ClearAccountsAction::kDefault, EXPECT_CALL(*password_store_, BeginTransaction);
// signin_metrics::ProfileSignout::USER_CLICKED_SIGNOUT_SETTINGS, EXPECT_CALL(*password_store_, NotifyLoginsChanged);
// signin_metrics::SignoutDelete::IGNORE_METRIC); EXPECT_CALL(*password_store_, CommitTransaction);
[sync_controller_ stopSyncAndClearIdentity];
// Ensures that |password_store_| has a chance to run its deletion task.
base::RunLoop().RunUntilIdle();
[delegate verify]; [delegate verify];
} }
...@@ -230,6 +238,10 @@ TEST_F(CWVSyncControllerTest, CurrentIdentity) { ...@@ -230,6 +238,10 @@ TEST_F(CWVSyncControllerTest, CurrentIdentity) {
EXPECT_CALL(*password_store_, NotifyLoginsChanged); EXPECT_CALL(*password_store_, NotifyLoginsChanged);
EXPECT_CALL(*password_store_, CommitTransaction); EXPECT_CALL(*password_store_, CommitTransaction);
[sync_controller_ stopSyncAndClearIdentity]; [sync_controller_ stopSyncAndClearIdentity];
// Ensures that |password_store_| has a chance to run its deletion task.
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(sync_controller_.currentIdentity); EXPECT_FALSE(sync_controller_.currentIdentity);
} }
......
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