chromium/extensions/renderer/gc_callback_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 "extensions/renderer/gc_callback.h"

#include "base/functional/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/features/feature.h"
#include "extensions/renderer/bindings/test_js_runner.h"
#include "extensions/renderer/scoped_web_frame.h"
#include "extensions/renderer/script_context.h"
#include "extensions/renderer/script_context_set.h"
#include "extensions/renderer/test_extensions_renderer_client.h"
#include "gin/function_template.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/web/web_frame.h"
#include "v8/include/v8.h"

namespace extensions {
namespace {

void SetToTrue(bool* value) {}

enum CallbackType {};

class GCCallbackTest : public testing::TestWithParam<CallbackType> {};

TEST_P(GCCallbackTest, GCBeforeContextInvalidated) {}

TEST_P(GCCallbackTest, ContextInvalidatedBeforeGC) {}

// Test the scenario of an object being garbage collected while the
// ScriptContext is valid, but the ScriptContext being invalidated before the
// callback has a chance to run.
TEST_P(GCCallbackTest,
       ContextInvalidatedBetweenGarbageCollectionAndCallbackRunning) {}

INSTANTIATE_TEST_SUITE_P();
INSTANTIATE_TEST_SUITE_P();
INSTANTIATE_TEST_SUITE_P();
INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace extensions