| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "public/web/WebNode.h" | 5 #include "public/web/WebNode.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 8 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
| 9 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| 10 #include "public/web/WebElement.h" | 11 #include "public/web/WebElement.h" |
| 11 #include "public/web/WebElementCollection.h" | 12 #include "public/web/WebElementCollection.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include <memory> | |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class WebNodeTest : public testing::Test { | 17 class WebNodeTest : public testing::Test { |
| 18 protected: | 18 protected: |
| 19 Document& document() { return m_pageHolder->document(); } | 19 Document& document() { return m_pageHolder->document(); } |
| 20 | 20 |
| 21 void setInnerHTML(const String& html) { | 21 void setInnerHTML(const String& html) { |
| 22 document().documentElement()->setInnerHTML(html); | 22 document().documentElement()->setInnerHTML(html); |
| 23 } | 23 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // WebNode::getElementsByHTMLTagName returns only HTML elements. | 60 // WebNode::getElementsByHTMLTagName returns only HTML elements. |
| 61 WebElementCollection collection = root().getElementsByHTMLTagName("label"); | 61 WebElementCollection collection = root().getElementsByHTMLTagName("label"); |
| 62 EXPECT_EQ(1u, collection.length()); | 62 EXPECT_EQ(1u, collection.length()); |
| 63 EXPECT_TRUE(collection.firstItem().hasHTMLTagName("label")); | 63 EXPECT_TRUE(collection.firstItem().hasHTMLTagName("label")); |
| 64 // The argument should be lower-case. | 64 // The argument should be lower-case. |
| 65 collection = root().getElementsByHTMLTagName("LABEL"); | 65 collection = root().getElementsByHTMLTagName("LABEL"); |
| 66 EXPECT_EQ(0u, collection.length()); | 66 EXPECT_EQ(0u, collection.length()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace blink | 69 } // namespace blink |
| OLD | NEW |