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

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

Issue 2024073002: Add callbacks to ScriptCustomElementDefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tryCatch 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/CustomElementsRegistry.h" 5 #include "core/dom/custom/CustomElementsRegistry.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptValue.h" 8 #include "bindings/core/v8/ScriptValue.h"
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/dom/Element.h" 10 #include "core/dom/Element.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 279
280 class LogUpgradeBuilder final : public CustomElementDefinitionBuilder { 280 class LogUpgradeBuilder final : public CustomElementDefinitionBuilder {
281 STACK_ALLOCATED(); 281 STACK_ALLOCATED();
282 WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder); 282 WTF_MAKE_NONCOPYABLE(LogUpgradeBuilder);
283 public: 283 public:
284 LogUpgradeBuilder() { } 284 LogUpgradeBuilder() { }
285 285
286 bool checkConstructorIntrinsics() override { return true; } 286 bool checkConstructorIntrinsics() override { return true; }
287 bool checkConstructorNotRegistered() override { return true; } 287 bool checkConstructorNotRegistered() override { return true; }
288 bool checkPrototype() override { return true; } 288 bool checkPrototype() override { return true; }
289 bool rememberOriginalProperties() override { return true; }
289 CustomElementDefinition* build( 290 CustomElementDefinition* build(
290 const CustomElementDescriptor& descriptor) { 291 const CustomElementDescriptor& descriptor) {
291 return new LogUpgradeDefinition(descriptor); 292 return new LogUpgradeDefinition(descriptor);
292 } 293 }
293 }; 294 };
294 295
295 TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements) 296 TEST_F(CustomElementsRegistryFrameTest, define_upgradesInDocumentElements)
296 { 297 {
297 ScriptForbiddenScope doNotRelyOnScript; 298 ScriptForbiddenScope doNotRelyOnScript;
298 299
(...skipping 12 matching lines...) Expand all
311 EXPECT_EQ(1u, definition->m_invocationCount) 312 EXPECT_EQ(1u, definition->m_invocationCount)
312 << "defining the element should have 'upgraded' the existing element"; 313 << "defining the element should have 'upgraded' the existing element";
313 EXPECT_EQ(element, definition->m_element) 314 EXPECT_EQ(element, definition->m_element)
314 << "the existing a-a element should have been upgraded"; 315 << "the existing a-a element should have been upgraded";
315 } 316 }
316 317
317 // TODO(dominicc): Add tests which adjust the "is" attribute when type 318 // TODO(dominicc): Add tests which adjust the "is" attribute when type
318 // extensions are implemented. 319 // extensions are implemented.
319 320
320 } // namespace blink 321 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698