#include "chrome/browser/v8_compile_hints/v8_compile_hints_tab_helper.h"
#include "base/test/bind.h"
#include "base/test/gmock_move_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/optimization_guide/mock_optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
#include "chrome/browser/sessions/session_tab_helper_factory.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/optimization_guide/core/optimization_guide_decision.h"
#include "components/optimization_guide/core/optimization_guide_features.h"
#include "content/public/test/navigation_simulator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
_;
An;
ByRef;
Invoke;
NiceMock;
namespace v8_compile_hints {
class V8CompileHintsTabHelperTest : public ChromeRenderViewHostTestHarness { … };
void V8CompileHintsTabHelperTest::SetUp() { … }
void V8CompileHintsTabHelperTest::TearDown() { … }
void V8CompileHintsTabHelperTest::NavigateAndCommitInFrame(
const std::string& url,
content::RenderFrameHost* rfh) { … }
namespace {
optimization_guide::OptimizationMetadata CreateMetadata(
size_t bloom_filter_size = V8CompileHintsTabHelper::kModelInt64Count,
int32_t clear_zeros = 50000,
int32_t clear_ones = 2000) { … }
optimization_guide::OptimizationMetadata CreateInvalidMetadata() { … }
optimization_guide::OptimizationMetadata CreateBadMetadata() { … }
}
TEST_F(V8CompileHintsTabHelperTest, DataFromOptimizationGuide) { … }
TEST_F(V8CompileHintsTabHelperTest, NonHttpNavigationIgnored) { … }
TEST_F(V8CompileHintsTabHelperTest, InvalidModelIgnored) { … }
TEST_F(V8CompileHintsTabHelperTest, BadModelIgnored) { … }
}