#include "chrome/browser/about_flags.h"
#include "base/command_line.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/unexpire_flags.h"
#include "chrome/browser/unexpire_flags_gen.h"
#include "chrome/common/chrome_version.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/flags_ui/feature_entry_macros.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "ui/base/window_open_disposition.h"
namespace {
const char kSwitchName[] = …;
const char kFlagName[] = …;
const char kExpiredFlagName[] = …;
const char kExpiredFlagSwitchName[] = …;
const char kFlagWithOptionSelectorName[] = …;
const char kFlagWithOptionSelectorSwitchName[] = …;
const char kUnsanitizedCommandLine[] = …;
const char kSanitizedCommandLine[] = …;
const char kUnsanitizedInput[] = …;
const char kSanitizedInput[] = …;
const char kSanitizedInputAndCommandLine[] = …;
void SimulateTextType(content::WebContents* contents,
const char* experiment_id,
const char* text) { … }
void ToggleEnableDropdown(content::WebContents* contents,
const char* experiment_id,
bool enable) { … }
std::string GetOriginListText(content::WebContents* contents,
const char* experiment_id) { … }
bool IsDropdownEnabled(content::WebContents* contents,
const char* experiment_id) { … }
bool IsFlagPresent(content::WebContents* contents, const char* experiment_id) { … }
void WaitForExperimentalFeatures(content::WebContents* contents) { … }
const std::vector<flags_ui::FeatureEntry> GetFeatureEntries(
const std::string& unexpire_name) { … }
class AboutFlagsBrowserTest : public InProcessBrowserTest,
public testing::WithParamInterface<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, PRE_OriginFlagDisabled) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, DISABLED_OriginFlagDisabled) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, PRE_OriginFlagEnabled) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, DISABLED_OriginFlagEnabled) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, ExpiryHidesFlag) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, PRE_ExpiredFlagDoesntApply) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, DISABLED_ExpiredFlagDoesntApply) { … }
#endif
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, RawFlagUnexpiryWorks) { … }
IN_PROC_BROWSER_TEST_P(AboutFlagsBrowserTest, FormRestore) { … }
}