| Index: chrome/test/data/webui/print_preview.js
|
| diff --git a/chrome/test/data/webui/print_preview.js b/chrome/test/data/webui/print_preview.js
|
| index 7d4a2adcba895a363e532094d78bbfea878ca6de..72e883041ee602386bb00d7a2368f3193d4af1fa 100644
|
| --- a/chrome/test/data/webui/print_preview.js
|
| +++ b/chrome/test/data/webui/print_preview.js
|
| @@ -398,3 +398,46 @@ TEST_F('PrintPreviewNoPDFWebUITest', 'TestErrorMessage', function() {
|
| assertNotEquals(null, errorText);
|
| expectFalse(errorText.classList.contains('hidden'));
|
| });
|
| +
|
| +/**
|
| + * Test fixture to test case when no PDF plugin exists.
|
| + * @extends {PrintPreviewWebUITest}
|
| + * @constructor
|
| + **/
|
| +function PrintPreviewPrintCloseWebUITest() {}
|
| +
|
| +PrintPreviewPrintCloseWebUITest.prototype = {
|
| + __proto__: PrintPreviewWebUITest.prototype,
|
| +
|
| + /**
|
| + * Open a page, which does window.print(); window.close();
|
| + * @type {?string}
|
| + * @override
|
| + **/
|
| + browsePrintPreload: 'print_preview_print_close_test.html',
|
| +
|
| + /**
|
| + * Indicate to browsertest not to print because the page will contain
|
| + * JavaScript to window.print().
|
| + * @type {boolean}
|
| + **/
|
| + noPrint: true,
|
| +
|
| + /**
|
| + * Provide a typedef for C++ to correspond to JS subclass.
|
| + * @type {?string}
|
| + * @override
|
| + **/
|
| + typedefCppFixture: 'PrintPreviewWebUITest',
|
| +};
|
| +
|
| +// Test that window.print(); window.close() still works with cancel.
|
| +TEST_F('PrintPreviewPrintCloseWebUITest', 'TestPrintCloseCancel', function() {
|
| + assertTrue(true);
|
| + this.mockHandler.expects(once()).closePrintPreviewTab().
|
| + will(callFunction(function() {
|
| + window.close();
|
| + }));
|
| +
|
| + $('cancel-button').click();
|
| +});
|
|
|