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

Side by Side Diff: chrome/renderer/print_web_view_helper_browsertest.cc

Issue 10873097: Merge 153342 - Print preview: Use an ID instead of memory pointer string in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h"
5 #include "chrome/common/chrome_switches.h" 6 #include "chrome/common/chrome_switches.h"
6 #include "chrome/common/print_messages.h" 7 #include "chrome/common/print_messages.h"
8 #include "chrome/renderer/mock_printer.h"
7 #include "chrome/renderer/print_web_view_helper.h" 9 #include "chrome/renderer/print_web_view_helper.h"
8 #include "chrome/test/base/chrome_render_view_test.h" 10 #include "chrome/test/base/chrome_render_view_test.h"
9 #include "content/public/renderer/render_view.h" 11 #include "content/public/renderer/render_view.h"
10 #include "printing/print_job_constants.h" 12 #include "printing/print_job_constants.h"
11 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
15 17
16 #if defined(OS_WIN) || defined(OS_MACOSX) 18 #if defined(OS_WIN) || defined(OS_MACOSX)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 "<body><p id=\"pdf-viewer\">Hello World!</p></body>"; 65 "<body><p id=\"pdf-viewer\">Hello World!</p></body>";
64 66
65 void CreatePrintSettingsDictionary(DictionaryValue* dict) { 67 void CreatePrintSettingsDictionary(DictionaryValue* dict) {
66 dict->SetBoolean(printing::kSettingLandscape, false); 68 dict->SetBoolean(printing::kSettingLandscape, false);
67 dict->SetBoolean(printing::kSettingCollate, false); 69 dict->SetBoolean(printing::kSettingCollate, false);
68 dict->SetInteger(printing::kSettingColor, printing::GRAY); 70 dict->SetInteger(printing::kSettingColor, printing::GRAY);
69 dict->SetBoolean(printing::kSettingPrintToPDF, true); 71 dict->SetBoolean(printing::kSettingPrintToPDF, true);
70 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); 72 dict->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX);
71 dict->SetInteger(printing::kSettingCopies, 1); 73 dict->SetInteger(printing::kSettingCopies, 1);
72 dict->SetString(printing::kSettingDeviceName, "dummy"); 74 dict->SetString(printing::kSettingDeviceName, "dummy");
73 dict->SetString(printing::kPreviewUIAddr, "0xb33fbeef"); 75 dict->SetInteger(printing::kPreviewUIID, 4);
74 dict->SetInteger(printing::kPreviewRequestID, 12345); 76 dict->SetInteger(printing::kPreviewRequestID, 12345);
75 dict->SetBoolean(printing::kIsFirstRequest, true); 77 dict->SetBoolean(printing::kIsFirstRequest, true);
76 dict->SetInteger(printing::kSettingMarginsType, printing::DEFAULT_MARGINS); 78 dict->SetInteger(printing::kSettingMarginsType, printing::DEFAULT_MARGINS);
77 dict->SetBoolean(printing::kSettingPreviewModifiable, false); 79 dict->SetBoolean(printing::kSettingPreviewModifiable, false);
78 dict->SetBoolean(printing::kSettingHeaderFooterEnabled, false); 80 dict->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
79 dict->SetBoolean(printing::kSettingGenerateDraftData, true); 81 dict->SetBoolean(printing::kSettingGenerateDraftData, true);
80 } 82 }
81 83
82 } // namespace 84 } // namespace
83 85
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 // Fill in some dummy values. 823 // Fill in some dummy values.
822 DictionaryValue dict; 824 DictionaryValue dict;
823 CreatePrintSettingsDictionary(&dict); 825 CreatePrintSettingsDictionary(&dict);
824 OnPrintForPrintPreview(dict); 826 OnPrintForPrintPreview(dict);
825 827
826 VerifyPrintFailed(true); 828 VerifyPrintFailed(true);
827 VerifyPagesPrinted(false); 829 VerifyPagesPrinted(false);
828 } 830 }
829 831
830 #endif // !defined(OS_CHROMEOS) 832 #endif // !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/renderer/print_web_view_helper.cc ('k') | printing/print_job_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698