#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "extensions/browser/extension_pref_value_map.h"
#include <stdint.h>
#include <memory>
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/prefs/pref_store_observer_mock.h"
#include "extensions/common/api/types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
const char kExt1[] = …;
const char kExt2[] = …;
const char kExt3[] = …;
const char kPref1[] = …;
const char kPref2[] = …;
const char kPref3[] = …;
const char kPref4[] = …;
}
static base::Value CreateVal(const char* str) { … }
static base::Time CreateTime(int64_t t) { … }
template <typename BASECLASS>
class ExtensionPrefValueMapTestBase : public BASECLASS { … };
class ExtensionPrefValueMapTest
: public ExtensionPrefValueMapTestBase<testing::Test> { … };
class ExtensionPrefValueMapObserverMock
: public ExtensionPrefValueMap::Observer { … };
TEST_F(ExtensionPrefValueMapTest, SetAndGetPrefValue) { … }
TEST_F(ExtensionPrefValueMapTest, GetNotSetPrefValue) { … }
TEST_F(ExtensionPrefValueMapTest, Override) { … }
TEST_F(ExtensionPrefValueMapTest, OverrideChecks) { … }
TEST_F(ExtensionPrefValueMapTest, SetAndGetPrefValueIncognito) { … }
TEST_F(ExtensionPrefValueMapTest, UninstallOnlyExtension) { … }
TEST_F(ExtensionPrefValueMapTest, UninstallIrrelevantExtension) { … }
TEST_F(ExtensionPrefValueMapTest, UninstallExtensionFromTop) { … }
TEST_F(ExtensionPrefValueMapTest, UninstallExtensionFromMiddle) { … }
TEST_F(ExtensionPrefValueMapTest, NotifyWhenNeeded) { … }
TEST_F(ExtensionPrefValueMapTest, DisableExt) { … }
TEST_F(ExtensionPrefValueMapTest, ReenableExt) { … }
struct OverrideIncognitoTestCase { … };
class ExtensionPrefValueMapTestIncognitoTests
: public ExtensionPrefValueMapTestBase<
testing::TestWithParam<OverrideIncognitoTestCase> > { … };
TEST_P(ExtensionPrefValueMapTestIncognitoTests, OverrideIncognito) { … }
INSTANTIATE_TEST_SUITE_P(…);