chromium/gin/wrappable_unittest.cc

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

#include "gin/wrappable.h"

#include "base/check.h"
#include "gin/arguments.h"
#include "gin/handle.h"
#include "gin/object_template_builder.h"
#include "gin/per_isolate_data.h"
#include "gin/public/isolate_holder.h"
#include "gin/test/v8_test.h"
#include "gin/try_catch.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "v8/include/v8-function.h"
#include "v8/include/v8-message.h"
#include "v8/include/v8-script.h"

namespace gin {

namespace {

// A non-member function to be bound to an ObjectTemplateBuilder.
void NonMemberMethod() {}

// This useless base class ensures that the value of a pointer to a MyObject
// (below) is not the same as the value of that pointer cast to the object's
// WrappableBase base.
class BaseClass {};

class MyObject : public BaseClass,
                 public Wrappable<MyObject> {};

class MyObject2 : public Wrappable<MyObject2> {};

class MyNamedObject : public Wrappable<MyNamedObject> {};

WrapperInfo MyObject::kWrapperInfo =;
WrapperInfo MyObject2::kWrapperInfo =;
WrapperInfo MyNamedObject::kWrapperInfo =;

}  // namespace

WrappableTest;

TEST_F(WrappableTest, WrapAndUnwrap) {}

TEST_F(WrappableTest, UnwrapFailures) {}

TEST_F(WrappableTest, GetAndSetProperty) {}

TEST_F(WrappableTest, MethodInvocationErrorsOnUnnamedObject) {}

TEST_F(WrappableTest, MethodInvocationErrorsOnNamedObject) {}

class MyObjectWithLazyProperties
    : public Wrappable<MyObjectWithLazyProperties> {};

WrapperInfo MyObjectWithLazyProperties::kWrapperInfo =;

TEST_F(WrappableTest, LazyPropertyGetterIsCalledOnce) {}

TEST_F(WrappableTest, LazyPropertyGetterCanBeSetFirst) {}

TEST_F(WrappableTest, LazyPropertyGetterCanBindSpecialArguments) {}

TEST_F(WrappableTest, CannotConstruct) {}

}  // namespace gin