chromium/chrome/browser/tpcd/support/trial_test_utils.h

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

#ifndef CHROME_BROWSER_TPCD_SUPPORT_TRIAL_TEST_UTILS_H_
#define CHROME_BROWSER_TPCD_SUPPORT_TRIAL_TEST_UTILS_H_

#include "base/run_loop.h"
#include "components/content_settings/core/browser/content_settings_observer.h"
#include "content/public/browser/web_contents_observer.h"
#include "services/network/public/mojom/cookie_access_observer.mojom.h"
#include "url/gurl.h"

namespace content {
class BrowserContext;
class WebContents;
}  // namespace content

namespace tpcd::trial {

CookieOperation;

inline constexpr char kTestTokenPublicKey[] =;

inline constexpr char kTrialEnabledDomain[] =;
inline constexpr char kTrialEnabledSubdomain[] =;
inline constexpr char kOtherTrialEnabledDomain[] =;
inline constexpr char kTrialEnabledIframePath[] =;
inline constexpr char kTrialEnabledTopLevelPath[] =;
inline constexpr char kEmbeddedScriptPagePath[] =;
inline constexpr char kSubdomainMatchingEmbeddedScriptPagePath[] =;
// Origin Trials token for `kTrialEnabledDomain` generated with:
// tools/origin_trials/generate_token.py  https://example.test Tpcd
// --expire-days 5000
inline constexpr char kTrialToken[] =;

// Origin Trials token for `kTrialEnabledDomain` (and all its subdomains)
// generated with:
// tools/origin_trials/generate_token.py https://example.test Tpcd
// --is-subdomain --expire-days 5000
inline constexpr char kTrialSubdomainMatchingToken[] =;

// Origin Trials token for `kTrialEnabledSiteSubdomain` (and all its subdomains)
// generated with:
// tools/origin_trials/generate_token.py https://sub.example.test Tpcd
// --is-subdomain --expire-days 5000
inline constexpr char kSubdomainTrialSubdomainMatchingToken[] =;

// Origin Trials token for `kTrialEnabledDomain` generated with:
// tools/origin_trials/generate_token.py  https://example.test TopLevelTpcd
// --expire-days 5000
const char k1pDeprecationTrialToken[] =;

// Origin Trials token for `kTrialEnabledDomain` (and all its subdomains)
// generated with:
// tools/origin_trials/generate_token.py https://example.test TopLevelTpcd
// --is-subdomain --expire-days 5000
const char k1pDeprecationTrialSubdomainMatchingToken[] =;

// Origin Trials token for `kTrialEnabledSiteSubdomain` generated with:
// tools/origin_trials/generate_token.py  https://sub.example.test TopLevelTpcd
// --expire-days 5000
const char kSubdomain1pDeprecationTrialToken[] =;

// Origin Trials token for `kTrialEnabledSiteSubdomain` (and all its subdomains)
// generated with:
// tools/origin_trials/generate_token.py https://sub.example.test TopLevelTpcd
// --is-subdomain --expire-days 5000
const char kSubdomain1pDeprecationTrialSubdomainMatchingToken[] =;

// Origin Trials token for `kOtherTrialEnabledDomain` generated with:
// tools/origin_trials/generate_token.py  https://example.test TopLevelTpcd
// --expire-days 5000
const char kOtherDomain1pDeprecationTrialToken[] =;

// Helper function for performing client side cookie access via JS.
void AccessCookieViaJsIn(content::WebContents* web_contents,
                         content::RenderFrameHost* frame);

class ContentSettingChangeObserver : public content_settings::Observer {};

class URLCookieAccessObserver : public content::WebContentsObserver {};

class FrameCookieAccessObserver : public content::WebContentsObserver {};

}  // namespace tpcd::trial

#endif  // CHROME_BROWSER_TPCD_SUPPORT_TRIAL_TEST_UTILS_H_