#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include <map>
#include <set>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "components/services/app_service/public/cpp/app_types.h"
#include "components/services/app_service/public/cpp/features.h"
#include "components/services/app_service/public/cpp/types_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace apps {
namespace {
apps::AppPtr MakeApp(const char* app_id,
const char* name,
apps::AppType app_type = apps::AppType::kArc,
apps::Readiness readiness = apps::Readiness::kUnknown,
bool should_update_icon_version = false) { … }
class MockRegistryObserver : public apps::AppRegistryCache::Observer { … };
MATCHER_P(HasAppId, app_id, "Has the correct app id") { … }
class RemoveObserver : public apps::AppRegistryCache::Observer { … };
class RecursiveObserver : public AppRegistryCache::Observer { … };
class InitializedObserver : public apps::AppRegistryCache::Observer { … };
}
class AppRegistryCacheTest : public testing::Test,
public AppRegistryCache::Observer { … };
TEST_F(AppRegistryCacheTest, OnApps) { … }
TEST_F(AppRegistryCacheTest, Removed) { … }
TEST_F(AppRegistryCacheTest, RemovedAndAdded) { … }
TEST_F(AppRegistryCacheTest, RemovedAndAddMultipleApps) { … }
TEST_F(AppRegistryCacheTest, Observer) { … }
TEST_F(AppRegistryCacheTest, Recursive) { … }
TEST_F(AppRegistryCacheTest, SuperRecursive) { … }
TEST_F(AppRegistryCacheTest, OnAppTypeInitializedWithUpdateFirst) { … }
TEST_F(AppRegistryCacheTest, OnAppTypeInitializedWithMultipleAppTypes) { … }
TEST_F(AppRegistryCacheTest, OnAppTypeInitializedWithEmptyUpdate) { … }
TEST_F(AppRegistryCacheTest, IsAppInstalledForInstalledApp) { … }
TEST_F(AppRegistryCacheTest, IsAppInstalledForUninstalledApp) { … }
TEST_F(AppRegistryCacheTest, OnAppUpdateCount) { … }
}