chromium/extensions/browser/extension_pref_value_map_unittest.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#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[] =;
}  // namespace

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> {};

// A gmock-ified implementation of PrefStore::Observer.
class ExtensionPrefValueMapObserverMock
    : public ExtensionPrefValueMap::Observer {};

TEST_F(ExtensionPrefValueMapTest, SetAndGetPrefValue) {}

TEST_F(ExtensionPrefValueMapTest, GetNotSetPrefValue) {}

// Make sure the last-installed extension wins for each preference.
TEST_F(ExtensionPrefValueMapTest, Override) {}

TEST_F(ExtensionPrefValueMapTest, OverrideChecks) {}

TEST_F(ExtensionPrefValueMapTest, SetAndGetPrefValueIncognito) {}

TEST_F(ExtensionPrefValueMapTest, UninstallOnlyExtension) {}

// Tests uninstalling an extension that wasn't winning for any preferences.
TEST_F(ExtensionPrefValueMapTest, UninstallIrrelevantExtension) {}

// Tests uninstalling an extension that was winning for all preferences.
TEST_F(ExtensionPrefValueMapTest, UninstallExtensionFromTop) {}

// Tests uninstalling an extension that was winning for only some preferences.
TEST_F(ExtensionPrefValueMapTest, UninstallExtensionFromMiddle) {}

// Tests triggering of notifications to registered observers.
TEST_F(ExtensionPrefValueMapTest, NotifyWhenNeeded) {}

// Tests disabling an extension.
TEST_F(ExtensionPrefValueMapTest, DisableExt) {}

// Tests disabling and reenabling an extension.
TEST_F(ExtensionPrefValueMapTest, ReenableExt) {}

struct OverrideIncognitoTestCase {};

class ExtensionPrefValueMapTestIncognitoTests
    : public ExtensionPrefValueMapTestBase<
          testing::TestWithParam<OverrideIncognitoTestCase> > {};

TEST_P(ExtensionPrefValueMapTestIncognitoTests, OverrideIncognito) {}

INSTANTIATE_TEST_SUITE_P();