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

Unified Diff: chrome/browser/resources/print_preview/print_preview.js

Issue 335583004: Added a test that currently is able to print to pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a directory for test files Created 6 years, 6 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/browser/resources/print_preview/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index ac3a0ab789135db2746d6fe3b522398b759867d9..b49c4b246107b8006f3b0718227c2d28f85d1a35 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -1040,4 +1040,25 @@ cr.define('print_preview', function() {
window.addEventListener('DOMContentLoaded', function() {
printPreview = new print_preview.PrintPreview();
printPreview.initialize();
+
+ function temp() {
+ chrome.send('UILoaded');
+ }
+ (function func() {
+ var settings = $('layout-settings');
+ if (settings.offsetWidth > 10) {
Lei Zhang 2014/06/13 22:20:11 So instead of looping and look for this as the sig
+ if (printPreview) {
+ printPreview.destinationStore_.selectDefaultDestination_();
+ var portrait = document.getElementsByClassName(
+ 'layout-settings-landscape-radio')[0];
+ if (portrait) {
+ portrait.click();
+ }
+ setTimeout(temp, 6000);
+ }
+ }
+ else {
+ setTimeout(func, 50);
+ }
+ })();
});

Powered by Google App Engine
This is Rietveld 408576698