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

Side by Side Diff: third_party/WebKit/Source/core/exported/WebNodeTest.cpp

Issue 2970833002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Created 3 years, 5 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 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 <memory>
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
11 #include "public/web/WebElement.h" 11 #include "public/web/WebElement.h"
12 #include "public/web/WebElementCollection.h" 12 #include "public/web/WebElementCollection.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
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& GetDocument() { return page_holder_->GetDocument(); } 19 Document& GetDocument() { return page_holder_->GetDocument(); }
20 20
21 void SetInnerHTML(const String& html) { 21 void SetInnerHTML(const String& html) {
22 GetDocument().documentElement()->setInnerHTML(html); 22 GetDocument().documentElement()->setInnerHTML(html);
23 } 23 }
24 24
25 WebNode Root() { return WebNode(GetDocument().documentElement()); } 25 WebNode Root() { return WebNode(GetDocument().documentElement()); }
26 26
27 private: 27 private:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/exported/WebElementTest.cpp ('k') | third_party/WebKit/Source/core/frame/DOMTimerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698