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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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>
12 13
13 namespace blink { 14 namespace blink {
14 15
15 static const char s_blockWithContinuations[] = 16 static const char s_blockWithContinuations[] =
16 "<head> <style> form {display: inline;} </style> </head>" 17 "<head> <style> form {display: inline;} </style> </head>"
17 "<body>" 18 "<body>"
18 " <form>" 19 " <form>"
19 " <div id='testElement'>" 20 " <div id='testElement'>"
20 " <input type='password' id='password'/>" 21 " <input type='password' id='password'/>"
21 " </div>" 22 " </div>"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 62
62 class WebElementTest : public testing::Test { 63 class WebElementTest : public testing::Test {
63 protected: 64 protected:
64 Document& document() { return m_pageHolder->document(); } 65 Document& document() { return m_pageHolder->document(); }
65 void insertHTML(String html); 66 void insertHTML(String html);
66 WebElement testElement(); 67 WebElement testElement();
67 68
68 private: 69 private:
69 void SetUp() override; 70 void SetUp() override;
70 71
71 OwnPtr<DummyPageHolder> m_pageHolder; 72 std::unique_ptr<DummyPageHolder> m_pageHolder;
72 }; 73 };
73 74
74 void WebElementTest::insertHTML(String html) 75 void WebElementTest::insertHTML(String html)
75 { 76 {
76 document().documentElement()->setInnerHTML(html, ASSERT_NO_EXCEPTION); 77 document().documentElement()->setInnerHTML(html, ASSERT_NO_EXCEPTION);
77 } 78 }
78 79
79 WebElement WebElementTest::testElement() 80 WebElement WebElementTest::testElement()
80 { 81 {
81 Element* element = document().getElementById("testElement"); 82 Element* element = document().getElementById("testElement");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EXPECT_FALSE(testElement().isEditable()); 150 EXPECT_FALSE(testElement().isEditable());
150 151
151 insertHTML("<input id=testElement disabled>"); 152 insertHTML("<input id=testElement disabled>");
152 EXPECT_FALSE(testElement().isEditable()); 153 EXPECT_FALSE(testElement().isEditable());
153 154
154 insertHTML("<fieldset disabled><div><input id=testElement></div></fieldset>" ); 155 insertHTML("<fieldset disabled><div><input id=testElement></div></fieldset>" );
155 EXPECT_FALSE(testElement().isEditable()); 156 EXPECT_FALSE(testElement().isEditable());
156 } 157 }
157 158
158 } // namespace blink 159 } // 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