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

Side by Side 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, 6 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);
rmcilroy 2016/05/23 10:51:38 nit - move this initialization into the initializa
mythria 2016/05/23 12:27:03 Done.
10 // Do not pass the object directly to observeGC function. This may 10 // Do initialization work in an inner function to avoid references to
11 // remain live on this function's stack preventing GC from collecting 11 // objects remaining live on this function's stack frame.
12 // it. Accessing the object inside an inner function will prevent any 12 // (http://crbug.com/595672/).
13 // unneeded references on this function's stack. 13 var markedRangeResultGC, selectedRangeResultGC;
14 var markedRangeResultGC = internals.observeGC((() => { 14 var firstRectForCharacterRangeGC;
15 return textInputController.markedRange(); 15 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.
16 })()); 16 markedRangeResultGC = internals.observeGC(
17 var selectedRangeResultGC = internals.observeGC((() => { 17 textInputController.markedRange());
18 return textInputController.selectedRange(); 18 selectedRangeResultGC = internals.observeGC(
19 })()); 19 textInputController.selectedRange());
20 var firstRectForCharacterRangeGC = internals.observeGC((() => { 20 firstRectForCharacterRangeGC = internals.observeGC(
21 return textInputController.firstRectForCharacterRange(0, 0); 21 textInputController.firstRectForCharacterRange(0, 0));
22 })()); 22 }
23
24 initialize();
23 gc(); 25 gc();
24 shouldBeTrue('markedRangeResultGC.wasCollected'); 26 shouldBeTrue('markedRangeResultGC.wasCollected');
25 shouldBeTrue('selectedRangeResultGC.wasCollected'); 27 shouldBeTrue('selectedRangeResultGC.wasCollected');
26 shouldBeTrue('firstRectForCharacterRangeGC.wasCollected'); 28 shouldBeTrue('firstRectForCharacterRangeGC.wasCollected');
27 </script> 29 </script>
28 </body> 30 </body>
29 </html> 31 </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