| Index: tracing/tracing/ui/extras/about_tracing/record_selection_dialog_test.html
|
| diff --git a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog_test.html b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog_test.html
|
| index cd9c7532359cc26c20b254d75314389e81c9cfd5..f5ead9ebf996836dcfb2f86e0633a9878e244518 100644
|
| --- a/tracing/tracing/ui/extras/about_tracing/record_selection_dialog_test.html
|
| +++ b/tracing/tracing/ui/extras/about_tracing/record_selection_dialog_test.html
|
| @@ -80,7 +80,8 @@ tr.b.unittest.testSuite(function() {
|
| assert.strictEqual(checkboxes[2].value, 'disabled-by-default-one');
|
| assert.isFalse(checkboxes[2].checked);
|
|
|
| - assert.strictEqual(dlg.categoryFilter(), '');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
|
|
| const labels = Polymer.dom(dlg).querySelectorAll('.categories label');
|
| assert.strictEqual(labels.length, 3);
|
| @@ -111,7 +112,8 @@ tr.b.unittest.testSuite(function() {
|
| assert.strictEqual(checkboxes[2].value, 'disabled-by-default-one');
|
| assert.isFalse(checkboxes[2].checked);
|
|
|
| - assert.strictEqual(dlg.categoryFilter(), '-three');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, ['three']);
|
|
|
| const labels = Polymer.dom(dlg).querySelectorAll('.categories label');
|
| assert.strictEqual(labels.length, 3);
|
| @@ -127,12 +129,15 @@ tr.b.unittest.testSuite(function() {
|
| dlg.currentlyChosenPreset = [];
|
| dlg.updateForm_();
|
|
|
| - assert.strictEqual(dlg.categoryFilter(), '');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
|
|
| const inputs =
|
| Polymer.dom(dlg).querySelector('input#disabled-by-default-bar').click();
|
|
|
| - assert.strictEqual(dlg.categoryFilter(), 'disabled-by-default-bar');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-bar']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
|
|
| assert.isFalse(
|
| tr.b.Settings.get('disabled-by-default-foo', false, 'categories'));
|
| @@ -162,13 +167,16 @@ tr.b.unittest.testSuite(function() {
|
| // Enables the three option, two already enabled.
|
| Polymer.dom(dlg).querySelector('.default-enabled-categories .all-btn')
|
| .click();
|
| - assert.strictEqual(dlg.categoryFilter(), '');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
| assert.isTrue(tr.b.Settings.get('three', false, 'categories'));
|
|
|
| // Disables three and two.
|
| Polymer.dom(dlg).querySelector('.default-enabled-categories .none-btn')
|
| .click();
|
| - assert.strictEqual(dlg.categoryFilter(), '-three,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['three', 'two']);
|
| assert.isFalse(tr.b.Settings.get('two', false, 'categories'));
|
| assert.isFalse(tr.b.Settings.get('three', false, 'categories'));
|
|
|
| @@ -179,14 +187,17 @@ tr.b.unittest.testSuite(function() {
|
| // Enables disabled category.
|
| Polymer.dom(dlg).querySelector('.default-disabled-categories .all-btn')
|
| .click();
|
| - assert.strictEqual(dlg.categoryFilter(), 'disabled-by-default-one');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-one']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
| assert.isTrue(
|
| tr.b.Settings.get('disabled-by-default-one', false, 'categories'));
|
|
|
| // Turn disabled by default back off.
|
| Polymer.dom(dlg).querySelector('.default-disabled-categories .none-btn')
|
| .click();
|
| - assert.strictEqual(dlg.categoryFilter(), '');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
| assert.isFalse(
|
| tr.b.Settings.get('disabled-by-default-one', false, 'categories'));
|
| });
|
| @@ -208,7 +219,9 @@ tr.b.unittest.testSuite(function() {
|
| dlg.updateForm_();
|
|
|
| // Make sure the default filter is returned.
|
| - assert.strictEqual(dlg.categoryFilter(), '-three,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['three', 'two']);
|
|
|
| // Make sure the default tracing types are returned.
|
| assert.strictEqual(dlg.tracingRecordMode, 'record-until-full');
|
| @@ -245,7 +258,9 @@ tr.b.unittest.testSuite(function() {
|
|
|
| // After the dialog is created, it should be using the default preset.
|
| let dlg = createDialog();
|
| - assert.strictEqual(dlg.categoryFilter(), '-one,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['one', 'two']);
|
| assert.isTrue(dlg.usingPreset_());
|
| assert.isFalse(
|
| dlg.querySelector('#category-preset-Manually-select-settings').checked);
|
| @@ -253,7 +268,9 @@ tr.b.unittest.testSuite(function() {
|
| // After clicking on "Edit Categories", the default preset should still be
|
| // used.
|
| dlg.onClickEditCategories();
|
| - assert.strictEqual(dlg.categoryFilter(), '-one,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['one', 'two']);
|
| assert.isTrue(dlg.usingPreset_());
|
| assert.isFalse(
|
| dlg.querySelector('#category-preset-Manually-select-settings').checked);
|
| @@ -262,7 +279,9 @@ tr.b.unittest.testSuite(function() {
|
| // "Manually select settings".
|
| Array.prototype.forEach.call(dlg.querySelectorAll('.categories input'),
|
| checkbox => checkbox.click());
|
| - assert.strictEqual(dlg.categoryFilter(), 'disabled-by-default-three');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-three']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, []);
|
| assert.isFalse(dlg.usingPreset_());
|
| assert.isTrue(
|
| dlg.querySelector('#category-preset-Manually-select-settings').checked);
|
| @@ -270,7 +289,9 @@ tr.b.unittest.testSuite(function() {
|
| // After the dialog is opened again, it should be using the default preset.
|
| // More importantly, the default preset should NOT be modified.
|
| dlg = createDialog();
|
| - assert.strictEqual(dlg.categoryFilter(), '-one,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['one', 'two']);
|
| assert.isTrue(dlg.usingPreset_());
|
| assert.isFalse(
|
| dlg.querySelector('#category-preset-Manually-select-settings').checked);
|
| @@ -295,8 +316,9 @@ tr.b.unittest.testSuite(function() {
|
| assert.isTrue(dlg.usingPreset_());
|
|
|
| // Make sure the default filter is returned.
|
| - assert.strictEqual(dlg.categoryFilter(),
|
| - '-three,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['three', 'two']);
|
|
|
| // Make sure the default tracing types are returned.
|
| assert.strictEqual(dlg.tracingRecordMode, 'record-as-much-as-possible');
|
| @@ -314,8 +336,9 @@ tr.b.unittest.testSuite(function() {
|
| assert.isFalse(dlg.usingPreset_());
|
|
|
| // Make sure the default filter is returned.
|
| - assert.strictEqual(
|
| - dlg.categoryFilter(), '-three,disabled-by-default-cc.debug');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-cc.debug']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, ['three']);
|
|
|
| // Make sure the tracing types set by catalog are returned.
|
| assert.strictEqual(dlg.tracingRecordMode, 'record-as-much-as-possible');
|
| @@ -326,8 +349,10 @@ tr.b.unittest.testSuite(function() {
|
| // Switch to the graphics, rendering, and rasterization preset.
|
| dlg.currentlyChosenPreset = ['blink', 'cc', 'renderer',
|
| 'disabled-by-default-cc.debug'];
|
| - assert.strictEqual(dlg.categoryFilter(),
|
| - 'disabled-by-default-cc.debug,-three,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-cc.debug']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['three', 'two']);
|
| });
|
|
|
| test('recordSelectionDialog_savedPreset', function() {
|
| @@ -346,7 +371,9 @@ tr.b.unittest.testSuite(function() {
|
| dlg.updateForm_();
|
|
|
| // Make sure the correct filter is returned.
|
| - assert.strictEqual(dlg.categoryFilter(), '-three,-two');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['three', 'two']);
|
|
|
| // Make sure the correct tracing types are returned.
|
| assert.strictEqual(dlg.tracingRecordMode, 'record-continuously');
|
| @@ -359,7 +386,8 @@ tr.b.unittest.testSuite(function() {
|
|
|
| // Switch to manual settings and verify the default values are not returned.
|
| dlg.currentlyChosenPreset = [];
|
| - assert.strictEqual(dlg.categoryFilter(), '-three');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included, []);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded, ['three']);
|
| assert.strictEqual(dlg.tracingRecordMode, 'record-continuously');
|
| assert.isTrue(dlg.useSystemTracing);
|
| assert.isTrue(dlg.useSampling);
|
| @@ -381,14 +409,18 @@ tr.b.unittest.testSuite(function() {
|
| dlg.currentlyChosenPreset = [];
|
| dlg.updateForm_();
|
|
|
| - assert.strictEqual(dlg.categoryFilter(),
|
| - '-cc,-disabled1,disabled-by-default-cc.debug');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-cc.debug']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['cc', 'disabled1']);
|
|
|
| // Switch to the graphics, rendering, and rasterization preset.
|
| dlg.currentlyChosenPreset = ['blink', 'cc', 'renderer',
|
| 'disabled-by-default-cc.debug'];
|
| - assert.strictEqual(dlg.categoryFilter(),
|
| - '-default1,disabled-by-default-cc.debug,-disabled1,-input');
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().included,
|
| + ['disabled-by-default-cc.debug']);
|
| + assert.deepEqual(dlg.includedAndExcludedCategories().excluded,
|
| + ['default1', 'disabled1', 'input']);
|
| });
|
| });
|
| </script>
|
|
|