Skip to content

Commit

Permalink
Print preview tests: Ensure that mocha.grep is used properly.
Browse files Browse the repository at this point in the history
Bug: 783334
Change-Id: Ibb3aa19df112fff00dae02112c956af20484b500
Reviewed-on: https://chromium-review.googlesource.com/772351
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516846}
  • Loading branch information
freshp86 authored and Commit Bot committed Nov 15, 2017
1 parent 003eedb commit 9204ed3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion chrome/test/data/webui/print_preview/print_preview_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ cr.define('print_preview_test', function() {
loadTimeData.getBoolean('printPdfAsImageEnabled'));
}

suite('PrintPreview', function() {
const suiteName = 'PrintPreview';

suite(suiteName, function() {
suiteSetup(function() {
function CloudPrintInterfaceStub() {
cr.EventTarget.call(this);
Expand Down Expand Up @@ -1725,4 +1727,8 @@ cr.define('print_preview_test', function() {
});
} // cr.isWindows
});

return {
suiteName: suiteName,
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PrintPreviewUIBrowserTest.prototype = {
'DISABLED_GenerateDraft',
].forEach(function(testName) {
TEST_F('PrintPreviewUIBrowserTest', testName, function() {
mocha.grep(new RegExp(testName + '\\b')).run();
runMochaTest(print_preview_test.suiteName, testName);
});
});

Expand All @@ -115,14 +115,14 @@ PrintPreviewUIBrowserTest.prototype = {
].forEach(function(testName) {
TEST_F('PrintPreviewUIBrowserTest', testName, function() {
this.accessibilityIssuesAreErrors = false;
mocha.grep(new RegExp(testName + '\\b')).run();
runMochaTest(print_preview_test.suiteName, testName);
});
});

GEN('#if !defined(OS_CHROMEOS)');
TEST_F('PrintPreviewUIBrowserTest', 'SystemDefaultPrinterPolicy', function() {
loadTimeData.overrideValues({useSystemDefaultPrinter: true});
mocha.grep(new RegExp('SystemDefaultPrinterPolicy' + '\\b')).run();
runMochaTest(print_preview_test.suiteName, 'SystemDefaultPrinterPolicy');
});
GEN('#endif');

Expand All @@ -132,7 +132,7 @@ GEN('#if defined(OS_MACOSX)');
'MacOpenPDFInPreviewBadPrintTicket',
].forEach(function(testName) {
TEST_F('PrintPreviewUIBrowserTest', testName, function() {
mocha.grep(new RegExp(testName + '\\b')).run();
runMochaTest(print_preview_test.suiteName, testName);
});
});
GEN('#endif');
Expand All @@ -143,7 +143,7 @@ GEN('#if defined(OS_WIN)');
'WinSystemDialogLinkBadPrintTicket',
].forEach(function(testName) {
TEST_F('PrintPreviewUIBrowserTest', testName, function() {
mocha.grep(new RegExp(testName + '\\b')).run();
runMochaTest(print_preview_test.suiteName, testName);
});
});
GEN('#endif');

0 comments on commit 9204ed3

Please sign in to comment.