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

Side by Side Diff: third_party/WebKit/Source/core/dom/AttrTest.cpp

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/Attr.h" 5 #include "core/dom/Attr.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 16 matching lines...) Expand all
27 m_value = "value"; 27 m_value = "value";
28 } 28 }
29 29
30 Attr* AttrTest::createAttribute() { 30 Attr* AttrTest::createAttribute() {
31 return m_document->createAttribute("name", ASSERT_NO_EXCEPTION); 31 return m_document->createAttribute("name", ASSERT_NO_EXCEPTION);
32 } 32 }
33 33
34 TEST_F(AttrTest, InitialValueState) { 34 TEST_F(AttrTest, InitialValueState) {
35 Attr* attr = createAttribute(); 35 Attr* attr = createAttribute();
36 EXPECT_EQ(emptyAtom, attr->value()); 36 EXPECT_EQ(emptyAtom, attr->value());
37 EXPECT_EQ(emptyString(), attr->toNode()->nodeValue()); 37 EXPECT_EQ(emptyString, attr->toNode()->nodeValue());
38 EXPECT_EQ(emptyString(), attr->textContent()); 38 EXPECT_EQ(emptyString, attr->textContent());
39 } 39 }
40 40
41 TEST_F(AttrTest, SetValue) { 41 TEST_F(AttrTest, SetValue) {
42 Attr* attr = createAttribute(); 42 Attr* attr = createAttribute();
43 attr->setValue(value()); 43 attr->setValue(value());
44 EXPECT_EQ(value(), attr->value()); 44 EXPECT_EQ(value(), attr->value());
45 EXPECT_EQ(value(), attr->toNode()->nodeValue()); 45 EXPECT_EQ(value(), attr->toNode()->nodeValue());
46 EXPECT_EQ(value(), attr->textContent()); 46 EXPECT_EQ(value(), attr->textContent());
47 } 47 }
48 48
(...skipping 14 matching lines...) Expand all
63 } 63 }
64 64
65 TEST_F(AttrTest, LengthOfContents) { 65 TEST_F(AttrTest, LengthOfContents) {
66 Attr* attr = createAttribute(); 66 Attr* attr = createAttribute();
67 EXPECT_EQ(0u, attr->lengthOfContents()); 67 EXPECT_EQ(0u, attr->lengthOfContents());
68 attr->setValue(value()); 68 attr->setValue(value());
69 EXPECT_EQ(0u, attr->lengthOfContents()); 69 EXPECT_EQ(0u, attr->lengthOfContents());
70 } 70 }
71 71
72 } // namespace blink 72 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | third_party/WebKit/Source/core/dom/CharacterData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698