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" | 8 <link rel="import" |
9 href="/tracing/ui/extras/about_tracing/mock_tracing_controller_client.html
"> | 9 href="/tracing/ui/extras/about_tracing/mock_tracing_controller_client.html
"> |
10 <link rel="import" | 10 <link rel="import" |
(...skipping 14 matching lines...) Expand all Loading... |
25 const mock = new tr.ui.e.about_tracing.MockTracingControllerClient(); | 25 const mock = new tr.ui.e.about_tracing.MockTracingControllerClient(); |
26 mock.expectRequest('endRecording', function() { | 26 mock.expectRequest('endRecording', function() { |
27 return ''; | 27 return ''; |
28 }); | 28 }); |
29 mock.expectRequest('getCategories', function() { | 29 mock.expectRequest('getCategories', function() { |
30 tr.b.timeout(20).then(() => | 30 tr.b.timeout(20).then(() => |
31 recordingPromise.selectionDlg.clickRecordButton()); | 31 recordingPromise.selectionDlg.clickRecordButton()); |
32 return ['a', 'b', 'c']; | 32 return ['a', 'b', 'c']; |
33 }); | 33 }); |
34 mock.expectRequest('beginRecording', function(recordingOptions) { | 34 mock.expectRequest('beginRecording', function(recordingOptions) { |
35 assert.typeOf(recordingOptions.categoryFilter, 'string'); | 35 assert.typeOf(recordingOptions.included_categories, 'array'); |
36 assert.typeOf(recordingOptions.useSystemTracing, 'boolean'); | 36 assert.typeOf(recordingOptions.excluded_categories, 'array'); |
37 assert.typeOf(recordingOptions.useSampling, 'boolean'); | 37 assert.typeOf(recordingOptions.enable_systrace, 'boolean'); |
38 assert.typeOf(recordingOptions.tracingRecordMode, 'string'); | 38 assert.typeOf(recordingOptions.record_mode, 'string'); |
39 tr.b.timeout(10).then(() => | 39 tr.b.timeout(10).then(() => |
40 recordingPromise.progressDlg.clickStopButton()); | 40 recordingPromise.progressDlg.clickStopButton()); |
41 return ''; | 41 return ''; |
42 }); | 42 }); |
43 mock.expectRequest('endRecording', function(data) { | 43 mock.expectRequest('endRecording', function(data) { |
44 return JSON.stringify(testData); | 44 return JSON.stringify(testData); |
45 }); | 45 }); |
46 | 46 |
47 const recordingPromise = tr.ui.e.about_tracing.beginRecording(mock); | 47 const recordingPromise = tr.ui.e.about_tracing.beginRecording(mock); |
48 | 48 |
49 return recordingPromise.then(function(data) { | 49 return recordingPromise.then(function(data) { |
50 mock.assertAllRequestsHandled(); | 50 mock.assertAllRequestsHandled(); |
51 assert.strictEqual(data, JSON.stringify(testData)); | 51 assert.strictEqual(data, JSON.stringify(testData)); |
52 }, function(error) { | 52 }, function(error) { |
53 assert.fail(error); | 53 assert.fail(error); |
54 }); | 54 }); |
55 }); | 55 }); |
56 }); | 56 }); |
57 </script> | 57 </script> |
OLD | NEW |