chromium/third_party/blink/renderer/core/content_capture/content_capture_test.cc

// Copyright 2019 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

#include "third_party/blink/renderer/core/content_capture/content_capture_manager.h"

#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/web/web_content_capture_client.h"
#include "third_party/blink/public/web/web_content_holder.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/core/html_element_type_helpers.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/layout_text.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/sim/sim_request.h"
#include "third_party/blink/renderer/core/testing/sim/sim_test.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"

namespace blink {

namespace {

gfx::Rect GetRect(LayoutObject* layout_object) {}

void FindNodeVectorsDiff(const Vector<Persistent<Node>>& a,
                         const Vector<Persistent<Node>>& b,
                         Vector<Persistent<Node>>& a_diff_b) {}

void FindNodeVectorsDiff(const Vector<Persistent<Node>>& a,
                         const Vector<Persistent<Node>>& b,
                         Vector<Persistent<Node>>& a_diff_b,
                         Vector<Persistent<Node>>& b_diff_a) {}

void FindNodeVectorsUnion(const Vector<Persistent<Node>>& a,
                          const Vector<Persistent<Node>>& b,
                          HashSet<Persistent<Node>>& a_and_b) {}

void ToNodeIds(const Vector<Persistent<Node>>& nodes,
               Vector<int64_t>& node_ids) {}

void ToNodeTexts(const Vector<Persistent<Node>>& nodes, Vector<String>& texts) {}

}  // namespace

class WebContentCaptureClientTestHelper : public WebContentCaptureClient {};

class ContentCaptureLocalFrameClientHelper : public EmptyLocalFrameClient {};

class ContentCaptureTest : public PageTestBase,
                           public ::testing::WithParamInterface<
                               std::vector<base::test::FeatureRef>> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(ContentCaptureTest, Basic) {}

TEST_P(ContentCaptureTest, Scrolling) {}

TEST_P(ContentCaptureTest, PauseAndResume) {}

TEST_P(ContentCaptureTest, NodeOnlySendOnce) {}

TEST_P(ContentCaptureTest, UnsentNode) {}

TEST_P(ContentCaptureTest, RemoveNodeBeforeSendingOut) {}

TEST_P(ContentCaptureTest, RemoveNodeInBetweenSendingOut) {}

TEST_P(ContentCaptureTest, RemoveNodeAfterSendingOut) {}

TEST_P(ContentCaptureTest, TaskHistogramReporter) {}

TEST_P(ContentCaptureTest, RescheduleTask) {}

TEST_P(ContentCaptureTest, NotRescheduleTask) {}

// TODO(michaelbai): use RenderingTest instead of PageTestBase for multiple
// frame test.
class ContentCaptureSimTest : public SimTest {};

const char* ContentCaptureSimTest::kEditableContent =;

TEST_F(ContentCaptureSimTest, MultiFrame) {}

TEST_F(ContentCaptureSimTest, AddNodeToMultiFrame) {}

TEST_F(ContentCaptureSimTest, ChangeNode) {}

TEST_F(ContentCaptureSimTest, ChangeNodeBeforeCapture) {}

TEST_F(ContentCaptureSimTest, DeleteNodeContent) {}

TEST_F(ContentCaptureSimTest, UserActivatedDelay) {}

}  // namespace blink