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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/gc.html

Issue 1952893003: Implement custom element construction and some 'define' checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement feedback. Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/isolated-worlds.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <body>
6 <script>
7 'use strict';
8 (() => {
9
10 if (!window.internals) {
11 // Requires observeGC
12 return;
13 }
14
15 promise_test((t) => {
16 var observation = null;
17 (() => {
18 let f = document.createElement('iframe');
19 f.srcdoc = 'content';
20 document.body.appendChild(f);
21 let w = f.contentWindow;
22
23 var X = new Object;
24 X.a = [f, w, w.customElements, w.document];
25 X.a.forEach((o) => o.x = X);
26 observation = internals.observeGC(X);
27
28 f.remove();
29 })();
30
31 return Promise.resolve()
32 .then(() => {
33 gc(); gc();
34 assert_true(observation.wasCollected,
35 'cyclic references between objects and DOM wrappers should ' +
36 'not leak');
37 });
38 }, 'Sanity check ordinary objects are not leaking');
39
40 promise_test((t) => {
41 var observation = null;
42 (() => {
43 let f = document.createElement('iframe');
44 f.srcdoc = 'content';
45 document.body.appendChild(f);
46 let w = f.contentWindow;
47
48 class X extends HTMLElement {}
49 X.a = [f, w, w.customElements, w.document];
50 X.a.forEach((o) => o.x = X);
51 w.customElements.define('a-a', X);
52 observation = internals.observeGC(X);
53
54 f.remove();
55 })();
56
57 return Promise.resolve()
58 .then(() => {
59 gc(); gc();
60 assert_true(observation.wasCollected,
61 'defining a custom element should not leak its constructor');
62 });
63 }, 'Defining custom elements does not leak');
64
65 })();
66 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/isolated-worlds.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698