#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/guest_view/browser/guest_view_manager.h"
#include "components/guest_view/browser/guest_view_manager_delegate.h"
#include "components/guest_view/browser/test_guest_view_manager.h"
#include "components/javascript_dialogs/app_modal_dialog_controller.h"
#include "components/javascript_dialogs/app_modal_dialog_view.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/update_user_activation_state_interceptor.h"
#include "extensions/browser/api/extensions_api_client.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_stream_manager.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_attach_helper.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_constants.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h"
#include "extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.h"
#include "extensions/browser/process_manager.h"
#include "extensions/common/constants.h"
#include "extensions/common/mojom/guest_view.mojom.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_response_headers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "printing/buildflags/buildflags.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/view.h"
#include "url/url_constants.h"
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
#include "chrome/browser/printing/test_print_preview_observer.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#endif
ExtensionsAPIClient;
MimeHandlerViewGuest;
TestMimeHandlerViewGuest;
GuestViewManager;
TestGuestViewManager;
TestGuestViewManagerFactory;
namespace {
const char kDataUrlCsv[] = …;
}
class ChromeMimeHandlerViewTest : public extensions::ExtensionApiTest { … };
namespace {
class UserActivationUpdateWaiter { … };
class StubDevToolsAgentHostClient : public content::DevToolsAgentHostClient { … };
}
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, Embedded) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
EmbedWithInitialCrossOriginFrame) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
DISABLED_NavigationRaceFromEmbedder) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
DISABLED_NavigationRaceFromCrossProcessRenderer) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, EmbedderFrameRemovedNoCrash) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
EmbedWithInitialFrameAcceptBeforeUnloadDialog) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, PostMessage) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, Basic) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, Iframe) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, NonAsciiHeaders) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, DataUrl) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, EmbeddedDataUrlObject) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, EmbeddedDataUrlEmbed) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, EmbeddedDataUrlLong) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, SingleRequest) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, BackgroundPage) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, TargetBlankAnchor) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, BeforeUnload_NoDialog) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, BeforeUnload_ShowDialog) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
BeforeUnloadEnabled_WithoutUserActivation) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
BeforeUnloadEnabled_WithUserActivation) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
ActivatePostMessageSupportOnce) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
AdoptNodeInOnLoadDoesNotCrash) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, DoNotLoadInSandboxedFrame) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, RejectPointLock) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
GuestDevToolsReloadsEmbedder) { … }
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest,
MimeHandlerViewInDisplayNoneFrameForGoogleApps) { … }
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, EmbeddedThenPrint) { … }
#endif
IN_PROC_BROWSER_TEST_F(ChromeMimeHandlerViewTest, FrameIterationBeforeAttach) { … }