#include "base/command_line.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/metrics/content/subprocess_metrics_provider.h"
#include "components/prefs/pref_service.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"
namespace {
const char url1[] = …;
const char url2[] = …;
const char url3[] = …;
const int kRestoreLastSession = …;
const int kRestoreUrls = …;
const int kRestoreNtp = …;
struct StartupPrefs { … };
struct LaunchNavigationBrowserTestParam { … };
void AppendUrlsToCmdLine(base::CommandLine* command_line,
net::EmbeddedTestServer* embedded_test_server,
const std::vector<std::string>& urls) { … }
base::Value::List ListValueFromTestUrls(
const std::vector<std::string>& test_urls,
net::EmbeddedTestServer* embedded_test_server) { … }
bool IsUserAgentLaunchNavTypeFeatureEnabled() { … }
}
class LaunchNavigationBrowserTest
: public InProcessBrowserTest,
public BrowserListObserver,
public testing::WithParamInterface<LaunchNavigationBrowserTestParam> { … };
class LaunchNavigationBrowserBasicTest : public LaunchNavigationBrowserTest { … };
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserBasicTest, CmdLineLaunch) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class LaunchNavigationBrowserRestartTest : public LaunchNavigationBrowserTest { … };
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserRestartTest,
PRE_CmdLineURLRestartTest) { … }
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserRestartTest,
CmdLineURLRestartTest) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class LaunchNavigationBrowserWithIFrameTest
: public LaunchNavigationBrowserTest { … };
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserWithIFrameTest,
CmdLineLaunchWithIFrame) { … }
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserWithIFrameTest,
CreateEmptyFrame) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
class LaunchNavigationBrowserWithPopupTest
: public LaunchNavigationBrowserTest { … };
IN_PROC_BROWSER_TEST_P(LaunchNavigationBrowserWithPopupTest,
CmdLineLaunchWithIFrame) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);