chromium/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc

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

#include "chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.h"

#include <memory>
#include <tuple>

#include "base/test/values_test_util.h"
#include "chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h"
#include "chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_test.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/mock_render_process_host.h"
#include "extensions/browser/api/declarative/rules_registry_service.h"
#include "extensions/browser/api/declarative_content/content_rules_registry.h"
#include "extensions/browser/renderer_startup_helper.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/mojom/host_id.mojom.h"
#include "extensions/common/mojom/renderer.mojom.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace extensions {

HasSubstr;
UnorderedElementsAre;
UnorderedElementsAreArray;

namespace {

// Class that implements the binding of a new Renderer mojom interface and
// can receive callbacks on it for testing validation.
class InterceptingRendererStartupHelper : public RendererStartupHelper,
                                          public mojom::Renderer {};

}  // namespace

class DeclarativeContentCssConditionTrackerTest
    : public DeclarativeContentConditionTrackerTest {};

TEST(DeclarativeContentCssPredicateTest, WrongCssDatatype) {}

TEST(DeclarativeContentCssPredicateTest, CssPredicate) {}

// Tests that adding and removing predicates causes a WatchPages message to be
// sent.
TEST_F(DeclarativeContentCssConditionTrackerTest, AddAndRemovePredicates) {}

// Tests that adding and removing predicates that specify the same CSS selector
// as an existing predicate does not cause a WatchPages message to be sent.
TEST_F(DeclarativeContentCssConditionTrackerTest,
       AddAndRemovePredicatesWithSameSelectors) {}

// Tests that WatchedPageChange messages result in evaluation requests, and
// cause the appropriate predicates to evaluate to true.
TEST_F(DeclarativeContentCssConditionTrackerTest, WatchedPageChange) {}

// Tests in-page and non-in-page navigations. Only the latter should reset
// matching selectors and result in an evaluation request.
TEST_F(DeclarativeContentCssConditionTrackerTest, Navigation) {}

// https://crbug.com/497586
TEST_F(DeclarativeContentCssConditionTrackerTest, WebContentsOutlivesTracker) {}

}  // namespace extensions