#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot_cache.h"
#include "base/test/scoped_feature_list.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "content/browser/browser_context_impl.h"
#include "content/browser/renderer_host/navigation_controller_impl.h"
#include "content/browser/renderer_host/navigation_entry_impl.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot_manager.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/restore_type.h"
#include "content/test/test_web_contents.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
namespace {
static NavigationEntryScreenshotCache* GetCacheForTab(WebContents* tab) { … }
NavigationEntry* GetEntryWithID(WebContents* tab, int nav_entry_id) { … }
void AssertEntryHasNoScreenshot(WebContents* tab, int nav_entry_id) { … }
}
class NavigationEntryScreenshotCacheTest : public RenderViewHostTestHarness { … };
TEST_F(NavigationEntryScreenshotCacheTest, GetRemoveBasic) { … }
TEST_F(NavigationEntryScreenshotCacheTest, DeletedNavEntry) { … }
TEST_F(NavigationEntryScreenshotCacheTest, CacheEvictionOneTab) { … }
TEST_F(NavigationEntryScreenshotCacheTest, MultipleCacheEvictionsOneTab) { … }
TEST_F(NavigationEntryScreenshotCacheTest,
AlwaysEvictFromLeastRecentlyUsedTabs) { … }
TEST_F(NavigationEntryScreenshotCacheTest, OnWebContentsDestroyed) { … }
TEST_F(NavigationEntryScreenshotCacheTest, OnMemoryPressureCritical) { … }
}