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

Unified Diff: third_party/WebKit/Source/wtf/RefPtrTest.cpp

Issue 2771783003: Move wtf_unittests to platform/wtf/. (Closed)
Patch Set: Rebase. Created 3 years, 9 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
Index: third_party/WebKit/Source/wtf/RefPtrTest.cpp
diff --git a/third_party/WebKit/Source/wtf/RefPtrTest.cpp b/third_party/WebKit/Source/wtf/RefPtrTest.cpp
deleted file mode 100644
index 9e0975a3ecb94720d8068926820d4760c9361378..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/wtf/RefPtrTest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2014 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 "wtf/RefPtr.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/StringImpl.h"
-
-namespace WTF {
-
-TEST(RefPtrTest, Basic) {
- RefPtr<StringImpl> string;
- EXPECT_TRUE(!string);
- string = StringImpl::create("test");
- EXPECT_TRUE(!!string);
- string.clear();
- EXPECT_TRUE(!string);
-}
-
-TEST(RefPtrTest, LeakRef) {
- RefPtr<StringImpl> string = StringImpl::create("test");
- EXPECT_TRUE(string);
- EXPECT_TRUE(string->hasOneRef());
- StringImpl* raw = string.get();
- StringImpl* leaked = string.leakRef();
- EXPECT_TRUE(!string);
- EXPECT_TRUE(leaked);
- EXPECT_TRUE(leaked->hasOneRef());
- EXPECT_EQ(raw, leaked);
- leaked->deref();
-}
-
-TEST(RefPtrTest, MoveAssignmentOperator) {
- RefPtr<StringImpl> a = StringImpl::create("a");
- RefPtr<StringImpl> b = StringImpl::create("b");
- b = std::move(a);
- EXPECT_TRUE(!!b);
- EXPECT_TRUE(!a);
-}
-
-class RefCountedClass : public RefCounted<RefCountedClass> {};
-
-TEST(RefPtrTest, ConstObject) {
- // This test is only to ensure we force the compilation of a const RefCounted
- // object to ensure the generated code compiles.
- RefPtr<const RefCountedClass> ptrToConst = adoptRef(new RefCountedClass());
-}
-
-} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/PassRefPtrTest.cpp ('k') | third_party/WebKit/Source/wtf/StringExtrasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698