| Index: chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
|
| diff --git a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
|
| index 43666a5e4aaecae29b52d51786642c49c96a17d3..db50a400ced88f9a1d448e0cec4f796de50c15a6 100644
|
| --- a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
|
| +++ b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "chrome/browser/sessions/session_service.h"
|
| +#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
|
| #include "chrome/browser/sync/test/integration/sessions_helper.h"
|
| #include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
|
| #include "chrome/browser/sync/test/integration/sync_test.h"
|
| @@ -152,3 +153,40 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, ResponseCodeIsPreserved) {
|
| }
|
| ASSERT_EQ(1, found_navigations);
|
| }
|
| +
|
| +IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, CookieJarMismatch) {
|
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
|
| +
|
| + ASSERT_TRUE(CheckInitialState(0));
|
| +
|
| + // Add a new session to client 0 and wait for it to sync.
|
| + ScopedWindowMap old_windows;
|
| + GURL url = GURL("http://127.0.0.1/bubba");
|
| + ASSERT_TRUE(OpenTabAndGetLocalWindows(0, url, old_windows.GetMutable()));
|
| + ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
|
| +
|
| + // The cookie jar mismatch value will be true by default due to
|
| + // the way integration tests trigger signin (which does not involve a normal
|
| + // web content signin flow).
|
| + sync_pb::ClientToServerMessage message;
|
| + ASSERT_TRUE(GetFakeServer()->GetLastCommitMessage(&message));
|
| + ASSERT_TRUE(message.commit().config_params().cookie_jar_mismatch());
|
| +
|
| + // Trigger a cookie jar change (user signing in to content area).
|
| + gaia::ListedAccount signed_in_account;
|
| + signed_in_account.gaia_id =
|
| + GetClient(0)->service()->signin()->GetAuthenticatedAccountId();
|
| + std::vector<gaia::ListedAccount> accounts;
|
| + accounts.push_back(signed_in_account);
|
| + GoogleServiceAuthError error(GoogleServiceAuthError::NONE);
|
| + GetClient(0)->service()->OnGaiaAccountsInCookieUpdated(accounts, error);
|
| +
|
| + // Trigger a sync and wait for it.
|
| + url = GURL("http://127.0.0.1/bubba2");
|
| + ASSERT_TRUE(OpenTabAndGetLocalWindows(0, url, old_windows.GetMutable()));
|
| + ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
|
| +
|
| + // Verify the cookie jar mismatch bool is set to false.
|
| + ASSERT_TRUE(GetFakeServer()->GetLastCommitMessage(&message));
|
| + ASSERT_FALSE(message.commit().config_params().cookie_jar_mismatch());
|
| +}
|
|
|