Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Unified Diff: o3d/gpu_plugin/np_utils/base_np_object_unittest.cc

Issue 196032: Replaced BaseNPObject with DefaultNPObject because...... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « o3d/gpu_plugin/np_utils/base_np_object_mock.cc ('k') | o3d/gpu_plugin/np_utils/default_np_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: o3d/gpu_plugin/np_utils/base_np_object_unittest.cc
===================================================================
--- o3d/gpu_plugin/np_utils/base_np_object_unittest.cc (revision 25135)
+++ o3d/gpu_plugin/np_utils/base_np_object_unittest.cc (working copy)
@@ -1,156 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "o3d/gpu_plugin/np_utils/base_np_object_mock.h"
-#include "o3d/gpu_plugin/np_utils/base_np_object.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using testing::StrictMock;
-
-namespace o3d {
-namespace gpu_plugin {
-
-class BaseNPObjectTest : public testing::Test {
- protected:
- virtual void SetUp() {
- np_class = BaseNPObject::GetNPClass<StrictMock<MockBaseNPObject> >();
-
- // Dummy identifier is never used with real NPAPI so it can point to
- // anything.
- identifier = this;
-
- // Make sure no MockBaseNPObject objects exist before test.
- ASSERT_EQ(0, MockBaseNPObject::count());
- }
-
- virtual void TearDown() {
- // Make sure no MockBaseNPObject leaked an object.
- ASSERT_EQ(0, MockBaseNPObject::count());
- }
-
- NPP_t npp_;
- const NPClass* np_class;
- NPIdentifier identifier;
- NPVariant args[3];
- NPVariant result;
-};
-
-
-TEST_F(BaseNPObjectTest, AllocateAndDeallocateObject) {
- EXPECT_EQ(0, MockBaseNPObject::count());
-
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
- EXPECT_TRUE(NULL != object);
-
- EXPECT_EQ(1, MockBaseNPObject::count());
-
- np_class->deallocate(object);
- EXPECT_EQ(0, MockBaseNPObject::count());
-}
-
-TEST_F(BaseNPObjectTest, InvalidateForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, Invalidate());
- np_class->invalidate(object);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, HasMethodForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, HasMethod(identifier));
- np_class->hasMethod(object, identifier);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, InvokeForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, Invoke(identifier, args, 3, &result));
- np_class->invoke(object, identifier, args, 3, &result);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, InvokeDefaultForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, InvokeDefault(args, 3, &result));
- np_class->invokeDefault(object, args, 3, &result);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, HasPropertyForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, HasProperty(identifier));
- np_class->hasProperty(object, identifier);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, GetPropertyForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, GetProperty(identifier, &result));
- np_class->getProperty(object, identifier, &result);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, SetPropertyForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, SetProperty(identifier, &result));
- np_class->setProperty(object, identifier, &result);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, RemovePropertyForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, RemoveProperty(identifier));
- np_class->removeProperty(object, identifier);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, EnumerateForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- NPIdentifier* identifier = NULL;
- uint32_t count;
- EXPECT_CALL(*object, Enumerate(&identifier, &count));
- np_class->enumerate(object, &identifier, &count);
-
- np_class->deallocate(object);
-}
-
-TEST_F(BaseNPObjectTest, ConstructForwards) {
- MockBaseNPObject* object = static_cast<MockBaseNPObject*>(
- np_class->allocate(&npp_, const_cast<NPClass*>(np_class)));
-
- EXPECT_CALL(*object, Construct(args, 3, &result));
- np_class->construct(object, args, 3, &result);
-
- np_class->deallocate(object);
-}
-} // namespace gpu_plugin
-} // namespace o3d
« no previous file with comments | « o3d/gpu_plugin/np_utils/base_np_object_mock.cc ('k') | o3d/gpu_plugin/np_utils/default_np_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698