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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementTest.cpp

Issue 2508793002: Make exceptionState parameter of Document::createElement() to have default value (Closed)
Patch Set: 2016-11-16T15:26:06 Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/dom/custom/CustomElement.h" 5 #include "core/dom/custom/CustomElement.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/SVGNames.h" 8 #include "core/SVGNames.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/custom/CustomElementDefinition.h" 10 #include "core/dom/custom/CustomElementDefinition.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // TODO(pdr): <font-face> should be V0NotCustomElement as per the spec, 179 // TODO(pdr): <font-face> should be V0NotCustomElement as per the spec,
180 // but was regressed to be V0WaitingForUpgrade in 180 // but was regressed to be V0WaitingForUpgrade in
181 // http://crrev.com/656913006 181 // http://crrev.com/656913006
182 {"font-face", CustomElementState::Uncustomized, 182 {"font-face", CustomElementState::Uncustomized,
183 Element::V0WaitingForUpgrade}, 183 Element::V0WaitingForUpgrade},
184 {"_-X", CustomElementState::Uncustomized, Element::V0WaitingForUpgrade}, 184 {"_-X", CustomElementState::Uncustomized, Element::V0WaitingForUpgrade},
185 }; 185 };
186 std::unique_ptr<DummyPageHolder> pageHolder = DummyPageHolder::create(); 186 std::unique_ptr<DummyPageHolder> pageHolder = DummyPageHolder::create();
187 Document& document = pageHolder->document(); 187 Document& document = pageHolder->document();
188 for (const auto& data : createElementData) { 188 for (const auto& data : createElementData) {
189 Element* element = document.createElement(data.name, ASSERT_NO_EXCEPTION); 189 Element* element = document.createElement(data.name);
190 EXPECT_EQ(data.state, element->getCustomElementState()) << data.name; 190 EXPECT_EQ(data.state, element->getCustomElementState()) << data.name;
191 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name; 191 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name;
192 192
193 element = document.createElementNS(HTMLNames::xhtmlNamespaceURI, data.name, 193 element = document.createElementNS(HTMLNames::xhtmlNamespaceURI, data.name,
194 ASSERT_NO_EXCEPTION); 194 ASSERT_NO_EXCEPTION);
195 EXPECT_EQ(data.state, element->getCustomElementState()) << data.name; 195 EXPECT_EQ(data.state, element->getCustomElementState()) << data.name;
196 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name; 196 EXPECT_EQ(data.v0state, element->getV0CustomElementState()) << data.name;
197 197
198 element = document.createElementNS(SVGNames::svgNamespaceURI, data.name, 198 element = document.createElementNS(SVGNames::svgNamespaceURI, data.name,
199 ASSERT_NO_EXCEPTION); 199 ASSERT_NO_EXCEPTION);
(...skipping 23 matching lines...) Expand all
223 223
224 // create an element with an uppercase tag name 224 // create an element with an uppercase tag name
225 Document& document = holder->document(); 225 Document& document = holder->document();
226 EXPECT_TRUE(document.isHTMLDocument()) 226 EXPECT_TRUE(document.isHTMLDocument())
227 << "this test requires a HTML document"; 227 << "this test requires a HTML document";
228 Element* element = document.createElement("A-A", shouldNotThrow); 228 Element* element = document.createElement("A-A", shouldNotThrow);
229 EXPECT_EQ(definition, element->customElementDefinition()); 229 EXPECT_EQ(definition, element->customElementDefinition());
230 } 230 }
231 231
232 } // namespace blink 232 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScopeTest.cpp ('k') | third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698