| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |