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

Side by Side Diff: tracing/tracing/core/test_utils.html

Issue 2955043002: Remove tr.b.asArray. (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/iteration_helpers.html"> 8 <link rel="import" href="/tracing/base/iteration_helpers.html">
9 <link rel="import" href="/tracing/importer/import.html"> 9 <link rel="import" href="/tracing/importer/import.html">
10 <link rel="import" href="/tracing/model/counter.html"> 10 <link rel="import" href="/tracing/model/counter.html">
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 opt_this = opt_this || this; 402 opt_this = opt_this || this;
403 this.currentIndent_ += spaces; 403 this.currentIndent_ += spaces;
404 if (breakLine) this.breakLine(); 404 if (breakLine) this.breakLine();
405 blockCallback.call(opt_this); 405 blockCallback.call(opt_this);
406 this.currentIndent_ -= spaces; 406 this.currentIndent_ -= spaces;
407 }, 407 },
408 408
409 formatSingleLineList(list, itemCallback, opt_this) { 409 formatSingleLineList(list, itemCallback, opt_this) {
410 opt_this = opt_this || this; 410 opt_this = opt_this || this;
411 this.push('['); 411 this.push('[');
412 tr.b.asArray(list).forEach(function(item, index) { 412 Array.from(list).forEach(function(item, index) {
413 if (index > 0) this.push(', '); 413 if (index > 0) this.push(', ');
414 itemCallback.call(opt_this, item, index); 414 itemCallback.call(opt_this, item, index);
415 }, this); 415 }, this);
416 this.push(']'); 416 this.push(']');
417 }, 417 },
418 418
419 formatMultiLineList(list, itemCallback, opt_this) { 419 formatMultiLineList(list, itemCallback, opt_this) {
420 opt_this = opt_this || this; 420 opt_this = opt_this || this;
421 this.push('['); 421 this.push('[');
422 this.indentBlock(2, false /* don't break line */, function() { 422 this.indentBlock(2, false /* don't break line */, function() {
423 tr.b.asArray(list).forEach(function(item, index) { 423 Array.from(list).forEach(function(item, index) {
424 if (index > 0) this.push(','); 424 if (index > 0) this.push(',');
425 this.breakLine(); 425 this.breakLine();
426 itemCallback.call(opt_this, item, index); 426 itemCallback.call(opt_this, item, index);
427 }, this); 427 }, this);
428 }, this); 428 }, this);
429 if (list.length > 0) this.breakLine(); 429 if (list.length > 0) this.breakLine();
430 this.push(']'); 430 this.push(']');
431 }, 431 },
432 432
433 formatString(string) { 433 formatString(string) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 const args = options.args || {}; 489 const args = options.args || {};
490 return new tr.model.InstantEvent( 490 return new tr.model.InstantEvent(
491 category, title, colorId, start, args); 491 category, title, colorId, start, args);
492 }; 492 };
493 493
494 return { 494 return {
495 TestUtils, 495 TestUtils,
496 }; 496 };
497 }); 497 });
498 </script> 498 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698