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

Unified Diff: gpu/np_utils/dynamic_np_object_unittest.cc

Issue 481007: Deleted np_utils library. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 | « gpu/np_utils/dynamic_np_object.cc ('k') | gpu/np_utils/np_browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/np_utils/dynamic_np_object_unittest.cc
===================================================================
--- gpu/np_utils/dynamic_np_object_unittest.cc (revision 34090)
+++ gpu/np_utils/dynamic_np_object_unittest.cc (working copy)
@@ -1,83 +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 <string>
-
-#include "gpu/np_utils/dynamic_np_object.h"
-#include "gpu/np_utils/np_browser_stub.h"
-#include "gpu/np_utils/np_utils.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using testing::Return;
-using testing::StrictMock;
-
-namespace np_utils {
-
-class NPDynamicNPObjectTest : public testing::Test {
- protected:
- virtual void SetUp() {
- object_ = NPCreateObject<DynamicNPObject>(NULL);
- }
-
- StubNPBrowser stub_browser_;
- NPObjectPointer<DynamicNPObject> object_;
-};
-
-TEST_F(NPDynamicNPObjectTest, HasPropertyReturnsFalseForMissingProperty) {
- EXPECT_FALSE(NPHasProperty(NULL, object_, "missing"));
-}
-
-TEST_F(NPDynamicNPObjectTest, GetPropertyReturnsFalseForMissingProperty) {
- int32 r;
- EXPECT_FALSE(NPGetProperty(NULL, object_, "missing", &r));
-}
-
-TEST_F(NPDynamicNPObjectTest, CanSetProperty) {
- EXPECT_TRUE(NPSetProperty(NULL, object_, "foo", 7));
- int32 r;
- EXPECT_TRUE(NPHasProperty(NULL, object_, "foo"));
- EXPECT_TRUE(NPGetProperty(NULL, object_, "foo", &r));
- EXPECT_EQ(7, r);
-}
-
-TEST_F(NPDynamicNPObjectTest, CanRemoveProperty) {
- EXPECT_TRUE(NPSetProperty(NULL, object_, "foo", 7));
- EXPECT_TRUE(NPHasProperty(NULL, object_, "foo"));
- EXPECT_FALSE(NPRemoveProperty(NULL, object_, "foo"));
- EXPECT_FALSE(NPHasProperty(NULL, object_, "foo"));
- int32 r;
- EXPECT_FALSE(NPGetProperty(NULL, object_, "foo", &r));
-}
-
-TEST_F(NPDynamicNPObjectTest, CanEnumerateProperties) {
- EXPECT_TRUE(NPSetProperty(NULL, object_, "foo", 7));
-
- NPIdentifier* names;
- uint32 num_names;
- EXPECT_TRUE(object_->_class->enumerate(object_.Get(), &names, &num_names));
-
- EXPECT_EQ(1, num_names);
- EXPECT_EQ(NPBrowser::get()->GetStringIdentifier("foo"), names[0]);
-
- NPBrowser::get()->MemFree(names);
-}
-
-// Properties should not be
-TEST_F(NPDynamicNPObjectTest, InvalidateNullsObjectProperties) {
- EXPECT_EQ(1, object_->referenceCount);
- {
- EXPECT_TRUE(NPSetProperty(NULL, object_, "foo", object_));
- EXPECT_TRUE(NPHasProperty(NULL, object_, "foo"));
- object_->_class->invalidate(object_.Get());
- EXPECT_TRUE(NPHasProperty(NULL, object_, "foo"));
- NPObjectPointer<DynamicNPObject> r;
- EXPECT_TRUE(NPGetProperty(NULL, object_, "foo", &r));
- EXPECT_TRUE(NULL == r.Get());
- }
- // Invalidate did not release object
- EXPECT_EQ(2, object_->referenceCount);
- NPBrowser::get()->ReleaseObject(object_.Get());
-}
-} // namespace np_utils
« no previous file with comments | « gpu/np_utils/dynamic_np_object.cc ('k') | gpu/np_utils/np_browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698