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

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

Issue 1950613005: Fixes tests that use internals.observeGC to work with Ignition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed special wrapper for internals.observeGC. Adds an inner function to pass the object. 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/fast/dom/NodeIterator/NodeIterator-dont-overcollect.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 <input id='text' type='text'></input> 3 <input id='text' type='text'></input>
4 4
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/js-test.js"></script>
6 <script> 6 <script>
7 var input = document.getElementById('text'); 7 var input = document.getElementById('text');
8 input.focus(); 8 input.focus();
9 textInputController.setMarkedText("hello", 0, 5); 9 textInputController.setMarkedText("hello", 0, 5);
10 var markedRangeResultGC = internals.observeGC(textInputController.marked Range()); 10 // Do not pass the object directly to observeGC function. This may
11 var selectedRangeResultGC = internals.observeGC(textInputController.sele ctedRange()); 11 // remain live on this function's stack preventing GC from collecting
12 var firstRectForCharacterRangeGC = internals.observeGC(textInputControll er.firstRectForCharacterRange(0, 0)); 12 // it. Accessing the object inside an inner function will prevent any
13 // unneeded references on this function's stack.
14 var markedRangeResultGC = internals.observeGC((() => {
15 return textInputController.markedRange();
16 })());
17 var selectedRangeResultGC = internals.observeGC((() => {
18 return textInputController.selectedRange();
19 })());
20 var firstRectForCharacterRangeGC = internals.observeGC((() => {
21 return textInputController.firstRectForCharacterRange(0, 0);
22 })());
13 gc(); 23 gc();
14 shouldBeTrue('markedRangeResultGC.wasCollected'); 24 shouldBeTrue('markedRangeResultGC.wasCollected');
15 shouldBeTrue('selectedRangeResultGC.wasCollected'); 25 shouldBeTrue('selectedRangeResultGC.wasCollected');
16 shouldBeTrue('firstRectForCharacterRangeGC.wasCollected'); 26 shouldBeTrue('firstRectForCharacterRangeGC.wasCollected');
17 </script> 27 </script>
18 </body> 28 </body>
19 </html> 29 </html>
OLDNEW
« 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