| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/dom/Attr.h" | 6 #include "core/dom/Attr.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include <gmock/gmock.h> | 9 #include <gmock/gmock.h> |
| 10 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
| 11 | 11 |
| 12 using namespace blink; | 12 namespace blink { |
| 13 | |
| 14 namespace { | |
| 15 | 13 |
| 16 class AttrTest : public ::testing::Test { | 14 class AttrTest : public ::testing::Test { |
| 17 protected: | 15 protected: |
| 18 virtual void SetUp() override; | 16 void SetUp() override; |
| 19 | 17 |
| 20 PassRefPtrWillBeRawPtr<Attr> createAttribute(); | 18 PassRefPtrWillBeRawPtr<Attr> createAttribute(); |
| 21 const AtomicString& value() const { return m_value; } | 19 const AtomicString& value() const { return m_value; } |
| 22 | 20 |
| 23 private: | 21 private: |
| 24 RefPtrWillBePersistent<Document> m_document; | 22 RefPtrWillBePersistent<Document> m_document; |
| 25 AtomicString m_value; | 23 AtomicString m_value; |
| 26 }; | 24 }; |
| 27 | 25 |
| 28 void AttrTest::SetUp() | 26 void AttrTest::SetUp() |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 73 } |
| 76 | 74 |
| 77 TEST_F(AttrTest, LengthOfContents) | 75 TEST_F(AttrTest, LengthOfContents) |
| 78 { | 76 { |
| 79 RefPtrWillBeRawPtr<Attr> attr = createAttribute(); | 77 RefPtrWillBeRawPtr<Attr> attr = createAttribute(); |
| 80 EXPECT_EQ(0u, attr->lengthOfContents()); | 78 EXPECT_EQ(0u, attr->lengthOfContents()); |
| 81 attr->setValue(value()); | 79 attr->setValue(value()); |
| 82 EXPECT_EQ(0u, attr->lengthOfContents()); | 80 EXPECT_EQ(0u, attr->lengthOfContents()); |
| 83 } | 81 } |
| 84 | 82 |
| 85 } // unnamed namespace | 83 } // namespace blink |
| OLD | NEW |