chromium/extensions/renderer/bindings/api_event_listeners_unittest.cc

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

#include "extensions/renderer/bindings/api_event_listeners.h"

#include <functional>
#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/test/mock_callback.h"
#include "base/test/values_test_util.h"
#include "base/values.h"
#include "extensions/common/event_filter.h"
#include "extensions/common/mojom/event_dispatcher.mojom.h"
#include "extensions/renderer/bindings/api_binding_test.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "extensions/renderer/bindings/api_binding_types.h"
#include "extensions/renderer/bindings/listener_tracker.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace extensions {

namespace {

APIEventListenersTest;
MockEventChangeHandler;

const char kFunction[] =;
const char kEvent[] =;
const char kContextOwner[] =;

APIEventListeners::ContextOwnerIdGetter CreateContextOwnerIdGetter() {}

}  // namespace

// Test unfiltered listeners.
TEST_F(APIEventListenersTest, UnfilteredListeners) {}

// Tests the invalidation of unfiltered listeners.
TEST_F(APIEventListenersTest, UnfilteredListenersInvalidation) {}

// Tests that unfiltered listeners ignore the filtering info.
TEST_F(APIEventListenersTest, UnfilteredListenersIgnoreFilteringInfo) {}

TEST_F(APIEventListenersTest, UnfilteredListenersMaxListenersTest) {}

TEST_F(APIEventListenersTest, UnfilteredListenersLazyListeners) {}

// Tests filtered listeners.
TEST_F(APIEventListenersTest, FilteredListeners) {}

// Tests that adding multiple listeners with the same filter doesn't trigger
// the update callback.
TEST_F(APIEventListenersTest,
       UnfilteredListenersWithSameFilterDontTriggerUpdate) {}

// Tests that trying to add a listener with an invalid filter fails.
TEST_F(APIEventListenersTest, UnfilteredListenersError) {}

// Tests that adding listeners for multiple different events is correctly
// recorded in the EventFilter.
TEST_F(APIEventListenersTest, MultipleUnfilteredListenerEvents) {}

// Tests the invalidation of filtered listeners.
TEST_F(APIEventListenersTest, FilteredListenersInvalidation) {}

TEST_F(APIEventListenersTest, FilteredListenersMaxListenersTest) {}

TEST_F(APIEventListenersTest, FilteredListenersLazyListeners) {}

}  // namespace extensions