#include <stddef.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "chrome/browser/sessions/chrome_tab_restore_service_client.h"
#include "chrome/browser/sessions/exit_type_service.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/sessions/session_service_utils.h"
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/sessions/tab_restore_service_load_waiter.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/chrome_render_view_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/history/core/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/sessions/content/content_live_tab.h"
#include "components/sessions/content/content_test_helper.h"
#include "components/sessions/core/serialized_navigation_entry_test_helper.h"
#include "components/sessions/core/session_types.h"
#include "components/sessions/core/tab_restore_service_client.h"
#include "components/sessions/core/tab_restore_service_impl.h"
#include "components/sessions/core/tab_restore_service_observer.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/render_view_test.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/user_agent/user_agent_metadata.h"
Entry;
Tab;
Window;
ExtraData;
NavigationEntry;
WebContentsTester;
ContentTestHelper;
SerializedNavigationEntry;
SerializedNavigationEntryTestHelper;
_;
Return;
class MockLiveTab : public sessions::LiveTab { … };
class MockLiveTabContext : public sessions::LiveTabContext { … };
class MockTabRestoreServiceClient : public sessions::TabRestoreServiceClient { … };
class TabRestoreTimeFactory : public sessions::tab_restore::TimeFactory { … };
class TabRestoreServiceImplTest : public ChromeRenderViewHostTestHarness { … };
class TabRestoreServiceImplWithMockClientTest
: public TabRestoreServiceImplTest { … };
TEST_F(TabRestoreServiceImplTest, Basic) { … }
TEST_F(TabRestoreServiceImplWithMockClientTest,
TabExtraDataPresentInHistoricalTab) { … }
TEST_F(TabRestoreServiceImplWithMockClientTest, WindowRestore) { … }
TEST_F(TabRestoreServiceImplTest, DontCreateEmptyTab) { … }
TEST_F(TabRestoreServiceImplTest, Restore) { … }
TEST_F(TabRestoreServiceImplTest, RestoreManyNavigations) { … }
TEST_F(TabRestoreServiceImplTest, RestorePinnedAndApp) { … }
TEST_F(TabRestoreServiceImplTest, DontCreateRestoredEntry) { … }
TEST_F(TabRestoreServiceImplTest, DeleteNavigationEntries) { … }
TEST_F(TabRestoreServiceImplTest, DeleteCurrentEntry) { … }
TEST_F(TabRestoreServiceImplTest, DeleteEntriesAndRecreate) { … }
TEST_F(TabRestoreServiceImplTest, DontPersistPostData) { … }
TEST_F(TabRestoreServiceImplTest, DontLoadTwice) { … }
TEST_F(TabRestoreServiceImplTest, LoadPreviousSession) { … }
TEST_F(TabRestoreServiceImplTest, DontLoadAfterRestore) { … }
TEST_F(TabRestoreServiceImplTest, DontLoadAfterCleanExit) { … }
TEST_F(TabRestoreServiceImplTest, DontSaveWhenSavingIsDisabled) { … }
TEST_F(TabRestoreServiceImplTest, DontLoadWhenSavingIsDisabled) { … }
TEST_F(TabRestoreServiceImplTest, WindowShowStateIsSet) { … }
TEST_F(TabRestoreServiceImplTest, LoadPreviousSessionAndTabs) { … }
TEST_F(TabRestoreServiceImplTest, LoadWindowBoundsAndWorkspace) { … }
TEST_F(TabRestoreServiceImplTest, LoadPreviousSessionAndTabsPinned) { … }
TEST_F(TabRestoreServiceImplTest, ManyWindowsInSessionService) { … }
TEST_F(TabRestoreServiceImplTest, TimestampSurvivesRestore) { … }
TEST_F(TabRestoreServiceImplTest, StatusCodesSurviveRestore) { … }
TEST_F(TabRestoreServiceImplTest, PruneEntries) { … }
TEST_F(TabRestoreServiceImplTest, PruneIsCalled) { … }
TEST_F(TabRestoreServiceImplTest, GoToLoadedWhenHaveMaxEntries) { … }
TEST_F(TabRestoreServiceImplTest, TabGroupsRestoredFromSessionData) { … }
TEST_F(TabRestoreServiceImplTest, TabExtraDataRestoredFromSessionData) { … }