#include "components/sync_sessions/synced_session_tracker.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/mock_callback.h"
#include "components/sessions/core/serialized_navigation_entry_test_helper.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync_sessions/mock_sync_sessions_client.h"
#include "components/sync_sessions/test_matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AssertionFailure;
AssertionResult;
AssertionSuccess;
ElementsAre;
IsEmpty;
IsNull;
Ne;
NotNull;
Pointee;
Return;
namespace sync_sessions {
namespace {
const char kValidUrl[] = …;
const char kSessionName[] = …;
const sync_pb::SyncEnums::DeviceType kDeviceType = …;
const syncer::DeviceInfo::FormFactor kFormFactor = …;
const char kTag[] = …;
const char kTag2[] = …;
const char kTag3[] = …;
const int kTabNode1 = …;
const int kTabNode2 = …;
const int kTabNode3 = …;
const int kTabNode4 = …;
const int kTabNode5 = …;
const SessionID kWindow1 = …;
const SessionID kWindow2 = …;
const SessionID kWindow3 = …;
const SessionID kTab1 = …;
const SessionID kTab2 = …;
const SessionID kTab3 = …;
const SessionID kTab4 = …;
const SessionID kTab5 = …;
const SessionID kTab6 = …;
const SessionID kTab7 = …;
MATCHER_P(HasSessionTag, expected_tag, "") { … }
}
class SyncedSessionTrackerTest : public testing::Test { … };
TEST_F(SyncedSessionTrackerTest, GetSession) { … }
TEST_F(SyncedSessionTrackerTest, GetTabUnmapped) { … }
TEST_F(SyncedSessionTrackerTest, PutWindowInSession) { … }
TEST_F(SyncedSessionTrackerTest, PutTabInWindow) { … }
TEST_F(SyncedSessionTrackerTest, LookupAllSessions) { … }
TEST_F(SyncedSessionTrackerTest, LookupAllForeignSessions) { … }
TEST_F(SyncedSessionTrackerTest, LookupSessionWindows) { … }
TEST_F(SyncedSessionTrackerTest, LookupSessionTab) { … }
TEST_F(SyncedSessionTrackerTest, Complex) { … }
TEST_F(SyncedSessionTrackerTest, ManyGetTabs) { … }
TEST_F(SyncedSessionTrackerTest, LookupTabNodeIds) { … }
TEST_F(SyncedSessionTrackerTest, SessionTracking) { … }
TEST_F(SyncedSessionTrackerTest, DeleteForeignTab) { … }
TEST_F(SyncedSessionTrackerTest, CleanupLocalTabs) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabMapped) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabMappedTwice) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabUnmapped) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabOldUnmappedNewMapped) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabSameTabId) { … }
TEST_F(SyncedSessionTrackerTest, ReassociateTabOldMappedNewUnmapped) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithHeader) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithIdenticalHeader) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithHeaderWithDuplicateTabIds) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithInvalidTab) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithHeaderWithDuplicateWindowId) { … }
TEST_F(SyncedSessionTrackerTest,
UpdateTrackerWithHeaderWithDuplicateWindowIdTwice) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTab) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTabThenHeader) { … }
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTwoTabsSameId) { … }
TEST_F(SyncedSessionTrackerTest, SerializeTrackerToSpecifics) { … }
TEST_F(SyncedSessionTrackerTest, SerializeTrackerToSpecificsWithEmptyHeader) { … }
}