#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "content/browser/code_cache/generated_code_cache.h"
#include <memory>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "content/common/features.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "net/base/network_isolation_key.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
class GeneratedCodeCacheTest : public testing::TestWithParam<bool> { … };
constexpr char GeneratedCodeCacheTest::kInitialUrl[];
constexpr char GeneratedCodeCacheTest::kInitialOrigin[];
constexpr char GeneratedCodeCacheTest::kInitialData[];
const size_t GeneratedCodeCacheTest::kMaxSizeInBytes;
TEST_P(GeneratedCodeCacheTest, GetResourceURLFromKey) { … }
TEST_P(GeneratedCodeCacheTest, CheckResponseTime) { … }
TEST_P(GeneratedCodeCacheTest, FetchEntry) { … }
TEST_P(GeneratedCodeCacheTest, WriteEntry) { … }
TEST_P(GeneratedCodeCacheTest, WriteLargeEntry) { … }
TEST_P(GeneratedCodeCacheTest, WriteVeryLargeEntry) { … }
TEST_P(GeneratedCodeCacheTest, DeleteEntry) { … }
TEST_P(GeneratedCodeCacheTest, WriteEntryWithEmptyData) { … }
TEST_P(GeneratedCodeCacheTest, WriteEntryFailure) { … }
TEST_P(GeneratedCodeCacheTest, WriteEntryFailureOutOfOrder) { … }
TEST_P(GeneratedCodeCacheTest, FetchEntryPendingOp) { … }
TEST_P(GeneratedCodeCacheTest, WriteEntryPendingOp) { … }
TEST_P(GeneratedCodeCacheTest, WriteLargeEntryPendingOp) { … }
TEST_P(GeneratedCodeCacheTest, WriteVeryLargeEntryPendingOp) { … }
TEST_P(GeneratedCodeCacheTest, DeleteEntryPendingOp) { … }
TEST_P(GeneratedCodeCacheTest, UpdateDataOfExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, UpdateDataOfSmallExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, UpdateDataOfLargeExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, UpdateDataOfVeryLargeExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, TruncateDataOfLargeExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, TruncateDataOfVeryLargeExistingEntry) { … }
TEST_P(GeneratedCodeCacheTest, FetchFailsForNonexistingOrigin) { … }
TEST_P(GeneratedCodeCacheTest, FetchEntriesFromSameOrigin) { … }
TEST_P(GeneratedCodeCacheTest, FetchSucceedsFromDifferentOrigins) { … }
TEST_P(GeneratedCodeCacheTest, VeryLargeEntriesAreMerged) { … }
TEST_P(GeneratedCodeCacheTest, StressVeryLargeEntries) { … }
TEST_P(GeneratedCodeCacheTest, FetchSucceedsEmptyOriginLock) { … }
TEST_P(GeneratedCodeCacheTest, FetchEmptyOriginVsValidOriginLocks) { … }
TEST_P(GeneratedCodeCacheTest, WasmCache) { … }
TEST_P(GeneratedCodeCacheTest, TestFailedBackendOpening) { … }
class TestBrowserClient : public ContentBrowserClient { … };
class GeneratedCodeCacheMetricsTest : public GeneratedCodeCacheTest { … };
TEST_P(GeneratedCodeCacheMetricsTest, JSWebUIMetricsWithEmbedderHostnames) { … }
TEST_P(GeneratedCodeCacheMetricsTest, JavaScriptMetrics) { … }
TEST_P(GeneratedCodeCacheMetricsTest, WebAssemblyMetrics) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}