#include <memory>
#include <string>
#include "base/functional/callback.h"
#include "base/memory/ref_counted.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/sync/sync_service_factory.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "components/services/storage/public/mojom/local_storage_control.mojom.h"
#include "components/services/storage/public/mojom/storage_usage_info.mojom.h"
#include "components/signin/public/base/signin_buildflags.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/identity_test_utils.h"
#include "components/sync/service/sync_service.h"
#include "components/sync/service/sync_user_settings.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/test/test_extension_dir.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/dom_storage/storage_area.mojom.h"
#include "url/gurl.h"
RunFunctionAndReturnSingleResult;
namespace {
class ExtensionBrowsingDataTest : public InProcessBrowserTest { … };
class ExtensionBrowsingDataTestWithStoragePartitioning
: public ExtensionBrowsingDataTest { … };
const char kRemoveEverythingArguments[] = …;
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
bool SetGaiaCookieForProfile(Profile* profile) { … }
#endif
}
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, Syncing) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, SyncError) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, NotSyncing) { … }
#endif
void CreateLocalStorageForKey(Profile* profile, const blink::StorageKey& key) { … }
std::vector<storage::mojom::StorageUsageInfoPtr> GetLocalStorage(
Profile* profile) { … }
bool UsageInfosHasStorageKey(
const std::vector<storage::mojom::StorageUsageInfoPtr>& usage_infos,
const blink::StorageKey& key) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, DeleteLocalStorageAll) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, DeleteLocalStorageIncognito) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, DeleteLocalStorageOrigin) { … }
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTestWithStoragePartitioning,
DeleteLocalStoragePartitioned) { … }
class BrowsingDataApiTest : public extensions::ExtensionApiTest { … };
IN_PROC_BROWSER_TEST_F(BrowsingDataApiTest, ValidateFilters) { … }