OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 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/base.html"> | 8 <link rel="import" href="/tracing/base/base.html"> |
9 <link rel="import" href="/tracing/base/base64.html"> | 9 <link rel="import" href="/tracing/base/base64.html"> |
10 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html"> | 10 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html"> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 var view = new ProfilingView(mock); | 53 var view = new ProfilingView(mock); |
54 view.style.height = '400px'; | 54 view.style.height = '400px'; |
55 view.style.border = '1px solid black'; | 55 view.style.border = '1px solid black'; |
56 this.addHTMLOutput(view); | 56 this.addHTMLOutput(view); |
57 | 57 |
58 return new Promise(function(resolve, reject) { | 58 return new Promise(function(resolve, reject) { |
59 var recordingPromise = view.beginRecording(); | 59 var recordingPromise = view.beginRecording(); |
60 | 60 |
61 var didAbort = false; | 61 var didAbort = false; |
62 function pressRecord() { | 62 function pressRecord() { |
63 if (didAbort) | 63 if (didAbort) return; |
64 return; | 64 |
65 recordingPromise.selectionDlg.clickRecordButton(); | 65 recordingPromise.selectionDlg.clickRecordButton(); |
66 setTimeout(pressStop, 60); | 66 setTimeout(pressStop, 60); |
67 } | 67 } |
68 function pressStop() { | 68 function pressStop() { |
69 recordingPromise.progressDlg.clickStopButton(); | 69 recordingPromise.progressDlg.clickStopButton(); |
70 } | 70 } |
71 setTimeout(pressRecord, 60); | 71 setTimeout(pressRecord, 60); |
72 recordingPromise.then( | 72 recordingPromise.then( |
73 function() { | 73 function() { |
74 resolve(); | 74 resolve(); |
75 }, | 75 }, |
76 function(err) { | 76 function(err) { |
77 didAbort = true; | 77 didAbort = true; |
78 reject(err); | 78 reject(err); |
79 }); | 79 }); |
80 }); | 80 }); |
81 }); | 81 }); |
82 }); | 82 }); |
83 </script> | 83 </script> |
84 | 84 |
OLD | NEW |