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

Side by Side Diff: third_party/WebKit/Source/web/WebElementTest.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/WebElement.h" 5 #include "public/web/WebElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/shadow/ShadowRoot.h" 9 #include "core/dom/shadow/ShadowRoot.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include <memory>
13 12
14 namespace blink { 13 namespace blink {
15 14
16 static const char s_blockWithContinuations[] = 15 static const char s_blockWithContinuations[] =
17 "<head> <style> form {display: inline;} </style> </head>" 16 "<head> <style> form {display: inline;} </style> </head>"
18 "<body>" 17 "<body>"
19 " <form>" 18 " <form>"
20 " <div id='testElement'>" 19 " <div id='testElement'>"
21 " <input type='password' id='password'/>" 20 " <input type='password' id='password'/>"
22 " </div>" 21 " </div>"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 61
63 class WebElementTest : public testing::Test { 62 class WebElementTest : public testing::Test {
64 protected: 63 protected:
65 Document& document() { return m_pageHolder->document(); } 64 Document& document() { return m_pageHolder->document(); }
66 void insertHTML(String html); 65 void insertHTML(String html);
67 WebElement testElement(); 66 WebElement testElement();
68 67
69 private: 68 private:
70 void SetUp() override; 69 void SetUp() override;
71 70
72 std::unique_ptr<DummyPageHolder> m_pageHolder; 71 OwnPtr<DummyPageHolder> m_pageHolder;
73 }; 72 };
74 73
75 void WebElementTest::insertHTML(String html) 74 void WebElementTest::insertHTML(String html)
76 { 75 {
77 document().documentElement()->setInnerHTML(html, ASSERT_NO_EXCEPTION); 76 document().documentElement()->setInnerHTML(html, ASSERT_NO_EXCEPTION);
78 } 77 }
79 78
80 WebElement WebElementTest::testElement() 79 WebElement WebElementTest::testElement()
81 { 80 {
82 Element* element = document().getElementById("testElement"); 81 Element* element = document().getElementById("testElement");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 EXPECT_FALSE(testElement().isEditable()); 149 EXPECT_FALSE(testElement().isEditable());
151 150
152 insertHTML("<input id=testElement disabled>"); 151 insertHTML("<input id=testElement disabled>");
153 EXPECT_FALSE(testElement().isEditable()); 152 EXPECT_FALSE(testElement().isEditable());
154 153
155 insertHTML("<fieldset disabled><div><input id=testElement></div></fieldset>" ); 154 insertHTML("<fieldset disabled><div><input id=testElement></div></fieldset>" );
156 EXPECT_FALSE(testElement().isEditable()); 155 EXPECT_FALSE(testElement().isEditable());
157 } 156 }
158 157
159 } // namespace blink 158 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698