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

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

Issue 2828643002: Make customElements.define faster
Patch Set: Remove some unneeded casts. Created 3 years, 7 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 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/CustomElementRegistry.h" 5 #include "core/dom/custom/CustomElementRegistry.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/V8BindingForCore.h" 9 #include "bindings/core/v8/V8BindingForCore.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 }; 259 };
260 260
261 class LogUpgradeBuilder final : public TestCustomElementDefinitionBuilder { 261 class LogUpgradeBuilder final : public TestCustomElementDefinitionBuilder {
262 STACK_ALLOCATED(); 262 STACK_ALLOCATED();
263 WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder); 263 WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder);
264 264
265 public: 265 public:
266 LogUpgradeBuilder() {} 266 LogUpgradeBuilder() {}
267 267
268 CustomElementDefinition* Build( 268 CustomElementDefinition* Build(const CustomElementDescriptor& descriptor,
269 const CustomElementDescriptor& descriptor) override { 269 CustomElementDefinition::Id) override {
270 return new LogUpgradeDefinition(descriptor); 270 return new LogUpgradeDefinition(descriptor);
271 } 271 }
272 }; 272 };
273 273
274 TEST_F(CustomElementRegistryTest, define_upgradesInDocumentElements) { 274 TEST_F(CustomElementRegistryTest, define_upgradesInDocumentElements) {
275 ScriptForbiddenScope do_not_rely_on_script; 275 ScriptForbiddenScope do_not_rely_on_script;
276 276
277 Element* element = CreateElement("a-a").InDocument(&GetDocument()); 277 Element* element = CreateElement("a-a").InDocument(&GetDocument());
278 element->setAttribute( 278 element->setAttribute(
279 QualifiedName(g_null_atom, "attr1", HTMLNames::xhtmlNamespaceURI), "v1"); 279 QualifiedName(g_null_atom, "attr1", HTMLNames::xhtmlNamespaceURI), "v1");
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 EXPECT_EQ(definition_b, definition); 441 EXPECT_EQ(definition_b, definition);
442 // look up undefined customized built-in element 442 // look up undefined customized built-in element
443 definition = Registry().DefinitionFor(CustomElementDescriptor("a-a", "div")); 443 definition = Registry().DefinitionFor(CustomElementDescriptor("a-a", "div"));
444 EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered"; 444 EXPECT_EQ(nullptr, definition) << "a-a, div should not be registered";
445 } 445 }
446 446
447 // TODO(dominicc): Add tests which adjust the "is" attribute when type 447 // TODO(dominicc): Add tests which adjust the "is" attribute when type
448 // extensions are implemented. 448 // extensions are implemented.
449 449
450 } // namespace blink 450 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698