#include "chrome/browser/extensions/cws_info_service.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/extensions/cws_info_service_factory.h"
#include "chrome/browser/extensions/cws_item_service.pb.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/browser/browser_context.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/extension_urls.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace extensions {
class CWSInfoServiceTest : public ::testing::Test,
public CWSInfoService::Observer { … };
CWSInfoServiceTest::CWSInfoServiceTest()
: … { … }
CWSInfoServiceTest::~CWSInfoServiceTest() = default;
scoped_refptr<const Extension> CWSInfoServiceTest::AddExtension(
const std::string& name,
bool updates_from_cws) { … }
StoreMetadata CWSInfoServiceTest::BuildStoreMetadata(
const ExtensionId& extension_id,
base::Time last_update_time) { … }
void CWSInfoServiceTest::VerifyCWSInfoRetrieved(
const StoreMetadata* metadata,
const std::optional<CWSInfoService::CWSInfo>& cws_info) { … }
TEST_F(CWSInfoServiceTest, QueriesCWSExtensions) { … }
TEST_F(CWSInfoServiceTest, IgnoresNonCWSExtensions) { … }
TEST_F(CWSInfoServiceTest, HandlesNetworkErrorAndBadServerResponse) { … }
TEST_F(CWSInfoServiceTest, SavesGoodResponse) { … }
TEST_F(CWSInfoServiceTest, HandlesMultipleRequestsPerInfoCheck) { … }
TEST_F(CWSInfoServiceTest, SchedulesStartupAndPeriodicInfoChecks) { … }
TEST_F(CWSInfoServiceTest, UpdatesExistingInfoAtUpdateIntervals) { … }
}