Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: chrome/test/data/webui/print_preview.js

Issue 7647010: Print preview page selection should not require a rerendering of draft pages. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed comment Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..dacefd0563fc1d7a626a87ba508f3b66d34069dd 100644
--- a/chrome/test/data/webui/print_preview.js
+++ b/chrome/test/data/webui/print_preview.js
@@ -39,7 +39,7 @@ PrintPreviewWebUITest.prototype = {
MockPrintPreviewHandler.prototype = {
getDefaultPrinter: function() {},
getPrinters: function() {},
- getPreview: function(settings) {},
+ getPreview: function(settings, draft_page_count, modifiable) {},
print: function(settings) {},
getPrinterCapabilities: function(printerName) {},
showSystemDialog: function() {},
@@ -72,8 +72,8 @@ PrintPreviewWebUITest.prototype = {
}));
var savedArgs = new SaveMockArguments();
mockHandler.stubs().getPreview(savedArgs.match(NOT_NULL)).
- will(callFunctionWithSavedArgs(savedArgs, function(options) {
- updatePrintPreview('title', true, 1, JSON.parse(options).requestID);
+ will(callFunctionWithSavedArgs(savedArgs, function(args) {
+ updatePrintPreview(1, JSON.parse(args[0]).requestID);
}));
mockHandler.stubs().getPrinters().
@@ -143,19 +143,21 @@ PrintPreviewWebUITest.prototype = {
* attaches an HTMLDivElement to the |mainview| element with attributes and
* empty methods, which are used by testing and that would be provided by the
* HTMLEmbedElement when the PDF plugin exists.
- * @param {string} previewUid Preview unique identifier.
+ * @param {number} srcDataIndex Preview data source index.
*/
- createPDFPlugin: function(previewUid) {
+ createPDFPlugin: function(srcDataIndex) {
var pdfViewer = $('pdf-viewer');
if (pdfViewer)
return;
+ var previewUid = 1;
pdfViewer = document.createElement('div');
pdfViewer.setAttribute('id', 'pdf-viewer');
pdfViewer.setAttribute('type',
'application/x-google-chrome-print-preview-pdf');
pdfViewer.setAttribute(
- 'src', 'chrome://print/' + previewUid + '/print.pdf');
+ 'src',
+ 'chrome://print/' + previewUid + '/' + srcDataIndex + '/print.pdf');
pdfViewer.setAttribute('aria-live', 'polite');
pdfViewer.setAttribute('aria-atomic', 'true');
function fakeFunction() {}
@@ -341,9 +343,8 @@ TEST_F('PrintPreviewWebUITest', 'TestColorSettings', function() {
TEST_F('PrintPreviewWebUITest', 'TestPrinterChangeUpdatesPreview', function() {
var savedArgs = new SaveMockArguments();
this.mockHandler.expects(once()).getPreview(savedArgs.match(ANYTHING)).
- will(callFunctionWithSavedArgs(savedArgs, function(options) {
- updatePrintPreview('title', true, 2,
- JSON.parse(options).requestID);
+ will(callFunctionWithSavedArgs(savedArgs, function(args) {
+ updatePrintPreview(2, JSON.parse(args[0]).requestID);
}));
this.mockGlobals.expects(once()).updateWithPrinterCapabilities(

Powered by Google App Engine
This is Rietveld 408576698