#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/path_service.h"
#include "base/process/process.h"
#include "base/run_loop.h"
#include "base/test/run_until.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/child_process_launcher_utils.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/no_renderer_crashes_assertion.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "media/base/media_switches.h"
#include "net/base/filename_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#if BUILDFLAG(IS_MAC)
#include "content/public/browser/browser_child_process_host.h"
#endif
WebContents;
namespace {
int RenderProcessHostCount() { … }
WebContents* FindFirstDevToolsContents() { … }
base::Process ProcessFromHandle(base::ProcessHandle handle) { … }
bool IsProcessBackgrounded(const base::Process& process) { … }
}
class ChromeRenderProcessHostTest : public extensions::ExtensionBrowserTest { … };
class ChromeRenderProcessHostTestWithCommandLine
: public ChromeRenderProcessHostTest { … };
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessPerTab) { … }
class ChromeRenderProcessHostBackgroundingTest
: public ChromeRenderProcessHostTest { … };
#define EXPECT_PROCESS_IS_BACKGROUNDED(process_or_tab) …
#define EXPECT_PROCESS_IS_FOREGROUNDED(process_or_tab) …
#if BUILDFLAG(IS_MAC)
#define MAYBE_MultipleTabs …
#else
#define MAYBE_MultipleTabs …
#endif
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostBackgroundingTest,
MAYBE_MultipleTabs) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, ProcessOverflow) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTestWithCommandLine,
ProcessOverflowCommandLine) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest,
DevToolsOnSelfInOwnProcessPPT) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest,
DevToolsOnSelfInOwnProcess) { … }
class WindowDestroyer : public content::WebContentsObserver { … };
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest,
DISABLED_CloseAllTabsDuringProcessDied) { … }
class ChromeRenderProcessHostBackgroundingTestWithAudio
: public ChromeRenderProcessHostTest { … };
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostBackgroundingTestWithAudio,
ProcessPriorityAfterStoppedAudio) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostBackgroundingTestWithAudio,
ProcessPriorityAfterAudioStopsOnNotVisibleTab) { … }
IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostBackgroundingTestWithAudio,
ProcessPriorityAfterAudioStartsFromBackgroundTab) { … }