mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 04:26:32 +08:00
This turns inspector-protocol/heap-profiler/heap-snapshot-with-no-detached-iframe.js into an e2e test. Bug: chromium: 1110817 Change-Id: I659e017e9d068515736e92a40b3ac7692dccf321 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2412328 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
21 lines
719 B
HTML
21 lines
719 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>
|
|
var frame = document.createElement('iframe');
|
|
frame.src = 'data:text/html,<script>class Retainer{}; var aUniqueName = new Retainer();<'+
|
|
'/script>';
|
|
document.body.appendChild(frame);
|
|
frame.addEventListener("load", function() {
|
|
var iframeWindow = this.contentWindow;
|
|
function retainingListener() {
|
|
// This is leaking the iframe.
|
|
console.log(iframeWindow);
|
|
}
|
|
document.body.addEventListener('click', retainingListener, true);
|
|
});
|
|
</script>
|