#include "chrome/browser/site_isolation/site_details.h"
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <utility>
#include <vector>
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/metrics/metrics_memory_details.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.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 "components/metrics/metrics_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/back_forward_cache_util.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/fenced_frame_test_util.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/switches.h"
#include "extensions/test/test_extension_dir.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
Bucket;
WebContents;
Extension;
TestExtensionDir;
ElementsAre;
PrintToString;
namespace {
class TestMemoryDetails : public MetricsMemoryDetails { … };
MATCHER_P3(DependingOnPolicy,
isolate_nothing,
isolate_extensions,
isolate_all_sites,
#if BUILDFLAG(IS_ANDROID)
std::string("(with oopifs disabled) ") +
PrintToString(isolate_nothing)
#else
content::AreAllSitesIsolatedForTesting()
? std::string("(under --site-per-process) ") +
PrintToString(isolate_all_sites)
: std::string("(under --isolate-extensions) ") +
PrintToString(isolate_extensions)
#endif
) { … }
MATCHER_P2(Sample,
bucket_min,
count,
std::string("is a Bucket whose count is ") + PrintToString(count) +
std::string(" and whose value is ") +
PrintToString(bucket_min)) { … }
template <typename P1, typename P2, typename P3>
void PrintTo(const DependingOnPolicyMatcherP3<P1, P2, P3>& matcher,
std::ostream* os) { … }
template <typename P1, typename P2>
void PrintTo(const SampleMatcherP2<P1, P2>& matcher, std::ostream* os) { … }
#define HasOneSample(x) …
}
class SiteDetailsBrowserTest : public extensions::ExtensionBrowserTest { … };
IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, DISABLED_ManyIframes) { … }
IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, DISABLED_IsolateExtensions) { … }
IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, ExtensionWithTwoWebIframes) { … }
IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest,
DISABLED_IsolateExtensionsHostedApps) { … }
IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest,
DISABLED_VerifySiteInstanceCountInBrowsingInstance) { … }
IN_PROC_BROWSER_TEST_F(
SiteDetailsBrowserTest,
DISABLED_VerifySiteInstanceCountInBrowsingInstanceWithExtensions) { … }
class PrerenderSiteDetailsBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(PrerenderSiteDetailsBrowserTest,
MemoryDetailsForPrerender) { … }
class FencedFrameSiteDetailsBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(FencedFrameSiteDetailsBrowserTest,
MemoryDetailsForFencedFrame) { … }
class BackForwardCacheSiteDetailsBrowserTest : public InProcessBrowserTest { … };
IN_PROC_BROWSER_TEST_F(BackForwardCacheSiteDetailsBrowserTest,
MemoryDetailsForBackForwardCache) { … }