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

Unified Diff: third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html

Issue 1999013002: Modify some gc related layout tests to work with Ignition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-dont-overcollect.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html
diff --git a/third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html b/third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html
index cc74c3d30184c09eba48f2dfcb50b61a9ce1ce82..d820b1d146860b17fec12b63eb7f079229ed2815 100644
--- a/third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html
+++ b/third_party/WebKit/LayoutTests/editing/input/text-input-controller-leak-document.html
@@ -7,19 +7,21 @@
var input = document.getElementById('text');
input.focus();
textInputController.setMarkedText("hello", 0, 5);
rmcilroy 2016/05/23 10:51:38 nit - move this initialization into the initializa
mythria 2016/05/23 12:27:03 Done.
- // Do not pass the object directly to observeGC function. This may
- // remain live on this function's stack preventing GC from collecting
- // it. Accessing the object inside an inner function will prevent any
- // unneeded references on this function's stack.
- var markedRangeResultGC = internals.observeGC((() => {
- return textInputController.markedRange();
- })());
- var selectedRangeResultGC = internals.observeGC((() => {
- return textInputController.selectedRange();
- })());
- var firstRectForCharacterRangeGC = internals.observeGC((() => {
- return textInputController.firstRectForCharacterRange(0, 0);
- })());
+ // Do initialization work in an inner function to avoid references to
+ // objects remaining live on this function's stack frame.
+ // (http://crbug.com/595672/).
+ var markedRangeResultGC, selectedRangeResultGC;
+ var firstRectForCharacterRangeGC;
+ function initialize() {
rmcilroy 2016/05/23 10:51:38 nit - you could just make these immediately exectu
mythria 2016/05/23 12:27:03 I fixed it in all the tests. Done.
+ markedRangeResultGC = internals.observeGC(
+ textInputController.markedRange());
+ selectedRangeResultGC = internals.observeGC(
+ textInputController.selectedRange());
+ firstRectForCharacterRangeGC = internals.observeGC(
+ textInputController.firstRectForCharacterRange(0, 0));
+ }
+
+ initialize();
gc();
shouldBeTrue('markedRangeResultGC.wasCollected');
shouldBeTrue('selectedRangeResultGC.wasCollected');
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/NodeIterator/NodeIterator-dont-overcollect.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698