chromium/extensions/renderer/bindings/api_last_error_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_last_error.h"

#include <optional>
#include <string_view>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "extensions/renderer/bindings/api_binding_test.h"
#include "extensions/renderer/bindings/api_binding_test_util.h"
#include "gin/converter.h"
#include "gin/public/context_holder.h"

namespace extensions {

namespace {

// Returns the v8 object for the lastError.
v8::Local<v8::Value> GetLastError(v8::Local<v8::Object> parent,
                                  v8::Local<v8::Context> context) {}

// Returns a stringified version of the lastError message, if one exists, and
// otherwise a stringified version of whatever the lastError property is (e.g.
// undefined).
std::string GetLastErrorMessage(v8::Local<v8::Object> parent,
                                v8::Local<v8::Context> context) {}

ContextParentPair;
ParentList;
v8::Local<v8::Object> GetParent(const ParentList& parents,
                                v8::Local<v8::Context> context,
                                v8::Local<v8::Object>* secondary_parent) {}

}  // namespace

APILastErrorTest;

// Test basic functionality of the lastError object.
TEST_F(APILastErrorTest, TestLastError) {}

// Test throwing an error if the last error wasn't checked.
TEST_F(APILastErrorTest, ReportIfUnchecked) {}

TEST_F(APILastErrorTest, ReportUncheckedError) {}

// Test behavior when something else sets a lastError property on the parent
// object.
TEST_F(APILastErrorTest, NonLastErrorObject) {}

// Test lastError in multiple different contexts.
TEST_F(APILastErrorTest, MultipleContexts) {}

TEST_F(APILastErrorTest, SecondaryParent) {}

}  // namespace extensions