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

Side by Side Diff: components/printing/test/print_web_view_helper_browsertest.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Created 3 years, 7 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
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 "components/printing/renderer/print_web_view_helper.h" 5 #include "components/printing/renderer/print_web_view_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <tuple> 10 #include <tuple>
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 int height_microns = 1045 int height_microns =
1046 static_cast<int>(page_size_in.height() * device_microns_per_unit); 1046 static_cast<int>(page_size_in.height() * device_microns_per_unit);
1047 int width_microns = 1047 int width_microns =
1048 static_cast<int>(page_size_in.width() * device_microns_per_unit); 1048 static_cast<int>(page_size_in.width() * device_microns_per_unit);
1049 auto media_size = base::MakeUnique<base::DictionaryValue>(); 1049 auto media_size = base::MakeUnique<base::DictionaryValue>();
1050 media_size->SetInteger(kSettingMediaSizeHeightMicrons, height_microns); 1050 media_size->SetInteger(kSettingMediaSizeHeightMicrons, height_microns);
1051 media_size->SetInteger(kSettingMediaSizeWidthMicrons, width_microns); 1051 media_size->SetInteger(kSettingMediaSizeWidthMicrons, width_microns);
1052 1052
1053 // Non default scaling value 1053 // Non default scaling value
1054 dict.SetInteger(kSettingScaleFactor, 80); 1054 dict.SetInteger(kSettingScaleFactor, 80);
1055 dict.Set(kSettingMediaSize, media_size.release()); 1055 dict.Set(kSettingMediaSize, std::move(media_size));
1056 1056
1057 OnPrintForPrintPreview(dict); 1057 OnPrintForPrintPreview(dict);
1058 1058
1059 VerifyPrintFailed(false); 1059 VerifyPrintFailed(false);
1060 VerifyPagesPrinted(true); 1060 VerifyPagesPrinted(true);
1061 #if defined(OS_WIN) 1061 #if defined(OS_WIN)
1062 VerifyPrintedPageSize(page_size_in); 1062 VerifyPrintedPageSize(page_size_in);
1063 #endif 1063 #endif
1064 } 1064 }
1065 1065
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 1154
1155 VerifyPrintFailed(true); 1155 VerifyPrintFailed(true);
1156 VerifyPagesPrinted(false); 1156 VerifyPagesPrinted(false);
1157 } 1157 }
1158 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) 1158 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
1159 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) 1159 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
1160 1160
1161 #endif // !defined(OS_CHROMEOS) 1161 #endif // !defined(OS_CHROMEOS)
1162 1162
1163 } // namespace printing 1163 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698