chromium/components/sync_sessions/synced_session_tracker_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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, "") {}

}  // namespace

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) {}

// Verifies that an invalid header (with duplicated tab IDs) is discarded.
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithHeaderWithDuplicateTabIds) {}

// Verifies that an invalid tab (with invalid ID) is discarded.
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithInvalidTab) {}

// Verifies that an invalid header (with duplicated window IDs) is discarded.
TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithHeaderWithDuplicateWindowId) {}

// Verifies that an invalid header with duplicated window IDs is ignored. It
// specifically tests feeding the same input twice to
// UpdateTrackerWithSpecifics(), as a regression test for crbug.com/803205 to
// verify that it at least doesn't crash.
TEST_F(SyncedSessionTrackerTest,
       UpdateTrackerWithHeaderWithDuplicateWindowIdTwice) {}

TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTab) {}

TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTabThenHeader) {}

TEST_F(SyncedSessionTrackerTest, UpdateTrackerWithTwoTabsSameId) {}

TEST_F(SyncedSessionTrackerTest, SerializeTrackerToSpecifics) {}

TEST_F(SyncedSessionTrackerTest, SerializeTrackerToSpecificsWithEmptyHeader) {}

}  // namespace sync_sessions