#include <memory>
#include <string>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/containers/flat_set.h"
#include "base/functional/bind.h"
#include "base/strings/strcat.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/browsing_data/content/browsing_data_helper.h"
#include "components/origin_trials/browser/origin_trials.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/origin_trials_controller_delegate.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/url_loader_interceptor.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace {
const char kTestTokenPublicKey[] = …;
const char kTrialEnabledDomain[] = …;
const char kEmbeddingDomain[] = …;
const char kFrobulatePersistentTrialName[] = …;
const char kFrobulatePersistentToken[] = …;
const char kTrialEnabledPath[] = …;
const char kCriticalTrialEnabledPath[] = …;
const char kPageWithOriginTrialResourcePath[] = …;
const char kPageWithEmbeddedFramePath[] = …;
const char kOriginTrialResourceJavascriptPath[] = …;
class OriginTrialsBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest, NoHeaderDoesNotEnableResponse) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest, ResponseEnablesOriginTrial) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
EmbeddedResponseEnablesPartitionedTrial) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
TrialEnabledAfterNavigationToOtherDomain) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
TrialDisabledAfterNavigationToSameDomain) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
CriticalOriginTrialRestartsRequest) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
NonCriticalTrialDoesNotRestart) { … }
IN_PROC_BROWSER_TEST_F(OriginTrialsBrowserTest,
OnlyNavigationRequestIsRestarted) { … }
}