#include "content/browser/renderer_host/isolated_web_app_throttle.h"
#include <optional>
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/common/page_type.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_renderer_host.h"
#include "content/test/navigation_simulator_impl.h"
#include "content/test/test_render_frame_host.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions_policy/permissions_policy_declaration.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom.h"
#include "ui/base/page_transition_types.h"
#include "url/origin.h"
namespace content {
namespace {
const char kAppUrl[] = …;
const char kAppUrl2[] = …;
const char kNonAppUrl[] = …;
const char kNonAppUrl2[] = …;
static constexpr WebExposedIsolationLevel kNotIsolated = …;
static constexpr WebExposedIsolationLevel kIsolatedApplication = …;
class IsolatedWebAppContentBrowserClient : public ContentBrowserClient { … };
}
class IsolatedWebAppThrottleTest : public RenderViewHostTestHarness { … };
TEST_F(IsolatedWebAppThrottleTest, AllowNavigationWithinNonApp) { … }
TEST_F(IsolatedWebAppThrottleTest, BlockNavigationIntoIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest, AllowNavigationIfNoPreviousPage) { … }
TEST_F(IsolatedWebAppThrottleTest, AllowNavigationWithinIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest, CancelCrossOriginNavigation) { … }
TEST_F(IsolatedWebAppThrottleTest, BlockRedirectOutOfIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest, AllowIframeNavigationOutOfApp) { … }
TEST_F(IsolatedWebAppThrottleTest,
BlockIframeRendererInitiatedNavigationIntoIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest,
AllowIframeBrowserInitiatedNavigationIntoIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest,
BlockIframeRedirectOutThenIntoIsolatedWebApp) { … }
TEST_F(IsolatedWebAppThrottleTest, BlockIsolatedIframeInNonIsolatedIframe) { … }
TEST_F(IsolatedWebAppThrottleTest, AllowHistoryNavigationFromErrorPage) { … }
}