OLD | NEW |
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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 selection.addRange(range); | 436 selection.addRange(range); |
437 document.execCommand('copy'); | 437 document.execCommand('copy'); |
438 | 438 |
439 // Restore the original selection. | 439 // Restore the original selection. |
440 selection.removeAllRanges(); | 440 selection.removeAllRanges(); |
441 for (var i = 0; i < originalRanges.length; i++) | 441 for (var i = 0; i < originalRanges.length; i++) |
442 selection.addRange(originalRanges[i]); | 442 selection.addRange(originalRanges[i]); |
443 }); | 443 }); |
444 | 444 |
445 var outputEl = document.createElement('div'); | 445 var outputEl = document.createElement('div'); |
446 outputEl.appendChild(copyButtonEl); | 446 Polymer.dom(outputEl).appendChild(copyButtonEl); |
447 outputEl.appendChild(testSourceEl); | 447 Polymer.dom(outputEl).appendChild(testSourceEl); |
448 test.addHTMLOutput(outputEl); | 448 test.addHTMLOutput(outputEl); |
449 }; | 449 }; |
450 | 450 |
451 TestUtils.newInstantEvent = function(options) { | 451 TestUtils.newInstantEvent = function(options) { |
452 var title = options.title; | 452 var title = options.title; |
453 var start = options.start; | 453 var start = options.start; |
454 if ((title === undefined) || | 454 if ((title === undefined) || |
455 (title === '') || | 455 (title === '') || |
456 (start === undefined)) | 456 (start === undefined)) |
457 throw new Error('too little information'); | 457 throw new Error('too little information'); |
458 | 458 |
459 var category = options.category || 'category'; | 459 var category = options.category || 'category'; |
460 var colorId = getColorId(options.colorId); | 460 var colorId = getColorId(options.colorId); |
461 var args = options.args || {}; | 461 var args = options.args || {}; |
462 return new tr.model.InstantEvent( | 462 return new tr.model.InstantEvent( |
463 category, title, colorId, start, args); | 463 category, title, colorId, start, args); |
464 }; | 464 }; |
465 | 465 |
466 return { | 466 return { |
467 TestUtils: TestUtils | 467 TestUtils: TestUtils |
468 }; | 468 }; |
469 }); | 469 }); |
470 </script> | 470 </script> |
OLD | NEW |