mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-10 21:54:47 +08:00
Replaces this layout test: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/web_tests/inspector-protocol/heap-profiler/heap-snapshot-with-detached-iframe.js Bug: 1110817 Change-Id: Ic173e4899c4fd7bcadc955ff3a34a6fa0e5a6acf Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2409979 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
22 lines
745 B
HTML
22 lines
745 B
HTML
<!--
|
|
Copyright 2020 The Chromium Authors. All rights reserved.
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
found in the LICENSE file.
|
|
-->
|
|
<h1>Memory Panel (Heap profiler) Test</h1>
|
|
<script>
|
|
const frame = document.createElement('iframe');
|
|
frame.src = 'data:text/html,<script>class Leak{}; var x = new Leak();<'+
|
|
'/script>';
|
|
document.body.appendChild(frame);
|
|
frame.addEventListener("load", function() {
|
|
const iframeWindow = this.contentWindow;
|
|
const retainingListener = () => {
|
|
// This is leaking the iframe.
|
|
console.log(iframeWindow);
|
|
}
|
|
document.body.addEventListener('click', retainingListener, true);
|
|
document.body.removeChild(this);
|
|
});
|
|
</script>
|