chromium/third_party/blink/renderer/core/speculation_rules/speculation_rules_origin_trial_test.cc

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

#include <algorithm>
#include <vector>

#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/features_generated.h"
#include "third_party/blink/public/common/origin_trials/scoped_test_origin_trial_policy.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_navigation_params.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/html_head_element.h"
#include "third_party/blink/renderer/core/html/html_meta_element.h"
#include "third_party/blink/renderer/core/html/html_script_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/speculation_rules/stub_speculation_host.h"
#include "third_party/blink/renderer/core/testing/dummy_page_holder.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

namespace blink {
namespace {

// Generated by:
//  tools/origin_trials/generate_token.py --version 3 --expire-days 3650 \
//      https://speculationrules.test SpeculationRulesPrefetch
// Token details:
//  Version: 3
//  Origin: https://speculationrules.test:443
//  Is Subdomain: None
//  Is Third Party: None
//  Usage Restriction: None
//  Feature: SpeculationRulesPrefetch
//  Expiry: 1936881669 (2031-05-18 14:41:09 UTC)
//  Signature (Base64):
//  dLwu1RhLf1iAH+NzRrTitAhWF9oFZFtDt7CjwaQENvBK7m/RECTJuFe2wj+5WTB7HIUkgbgtzhp50pelkGG4BA==
[[maybe_unused]] constexpr char kSpeculationRulesPrefetchToken[] =;

[[maybe_unused]] constexpr char kSimplePrefetchProxyRuleSet[] =;

// Similar to SpeculationRuleSetTest.PropagatesToDocument.
[[maybe_unused]] ::testing::AssertionResult DocumentAcceptsRuleSet(
    const char* trial_token,
    const char* json) {}

class ScopedRegisterMockedURLLoads {};

void CommitTestNavigation(
    LocalFrame& frame,
    const KURL& url,
    const Vector<std::pair<String, String>>& response_headers) {}

// Generated by:
//  tools/origin_trials/generate_token.py --version 3 --expire-days 3650 \
//      https://speculationrules.test SpeculationRulesPrefetchFuture
// Token details:
//  Version: 3
//  Origin: https://speculationrules.test:443
//  Is Subdomain: None
//  Is Third Party: None
//  Usage Restriction: None
//  Feature: SpeculationRulesPrefetchFuture
//  Expiry: 1984756547 (2032-11-22 17:15:47 UTC)
//  Signature (Base64):
//  rnDep07eDfunGZCJ7Czq4/VuMhHmpvhRfRHDHtIfdVhsXetfeGLgRSqpDujMb+R8TlYw6sGWBgeOws+YeNa7Ag==
[[maybe_unused]] constexpr char kSpeculationRulesPrefetchFutureToken[] =;

TEST(SpeculationRulesPrefetchFutureOriginTrialTest, FirstPartyTrialToken) {}

}  // namespace
}  // namespace blink