#include "content/public/test/content_browser_test_utils.h"
#include <string>
#include <utility>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/threading/thread_restrictions.h"
#include "base/uuid.h"
#include "build/build_config.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/media/video_capture_manager.h"
#include "content/browser/site_instance_impl.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_paths.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_frame_navigation_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_javascript_dialog_manager.h"
#include "net/base/filename_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#if BUILDFLAG(IS_WIN)
#include "ui/views/test/desktop_window_tree_host_win_test_api.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
#endif
namespace content {
base::FilePath GetTestFilePath(const char* dir, const char* file) { … }
GURL GetTestUrl(const char* dir, const char* file) { … }
void NavigateToURLBlockUntilNavigationsComplete(
Shell* window,
const GURL& url,
int number_of_navigations,
bool ignore_uncommitted_navigations) { … }
void ReloadBlockUntilNavigationsComplete(Shell* window,
int number_of_navigations) { … }
void ReloadBypassingCacheBlockUntilNavigationsComplete(
Shell* window,
int number_of_navigations) { … }
bool NavigateToURL(Shell* window, const GURL& url) { … }
bool NavigateToURL(Shell* window,
const GURL& url,
const GURL& expected_commit_url) { … }
bool NavigateToURLAndExpectNoCommit(Shell* window, const GURL& url) { … }
AppModalDialogWaiter::AppModalDialogWaiter(Shell* shell) : … { … }
void AppModalDialogWaiter::Restart() { … }
void AppModalDialogWaiter::Wait() { … }
void AppModalDialogWaiter::EarlyCallback() { … }
RenderFrameHost* ConvertToRenderFrameHost(Shell* shell) { … }
void LookupAndLogNameAndIdOfFirstCamera() { … }
ShellAddedObserver::ShellAddedObserver() { … }
ShellAddedObserver::~ShellAddedObserver() = default;
Shell* ShellAddedObserver::GetShell() { … }
void ShellAddedObserver::ShellCreated(Shell* shell) { … }
void IsolateOriginsForTesting(
net::test_server::EmbeddedTestServer* embedded_test_server,
WebContents* web_contents,
std::vector<std::string> hostnames_to_isolate) { … }
void IsolateOriginsForTesting(
net::test_server::EmbeddedTestServer* embedded_test_server,
WebContents* web_contents,
std::vector<url::Origin> origins_to_isolate) { … }
#if BUILDFLAG(IS_WIN)
void SetMockCursorPositionForTesting(WebContents* web_contents,
const gfx::Point& position) {
views::test::DesktopWindowTreeHostWinTestApi host(
static_cast<views::DesktopWindowTreeHostWin*>(
web_contents->GetNativeView()->GetHost()));
host.SetMockCursorPositionForTesting(position);
}
#endif
}