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

Unified Diff: components/printing/test/print_web_view_helper_browsertest.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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: components/printing/test/print_web_view_helper_browsertest.cc
diff --git a/components/printing/test/print_web_view_helper_browsertest.cc b/components/printing/test/print_web_view_helper_browsertest.cc
index ecdd7953c2be982e56f4aa3ea5ceaf7a00232281..c6e58cb58d851520a9ce256956068cf4e3d10d34 100644
--- a/components/printing/test/print_web_view_helper_browsertest.cc
+++ b/components/printing/test/print_web_view_helper_browsertest.cc
@@ -2,16 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "components/printing/renderer/print_web_view_helper.h"
+
#include <stddef.h>
+#include <memory>
#include <tuple>
+#include <utility>
#include "base/command_line.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "components/printing/common/print_messages.h"
-#include "components/printing/renderer/print_web_view_helper.h"
#include "components/printing/test/mock_printer.h"
#include "components/printing/test/print_mock_render_thread.h"
#include "components/printing/test/print_test_content_renderer_client.h"
@@ -869,12 +872,13 @@ TEST_F(MAYBE_PrintWebViewHelperPreviewTest, OnPrintPreviewForSelectedPages) {
// Set a page range and update the dictionary to generate only the complete
// metafile with the selected pages. Page numbers used in the dictionary
// are 1-based.
- base::DictionaryValue* page_range = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> page_range(
+ new base::DictionaryValue());
page_range->SetInteger(kSettingPageRangeFrom, 2);
page_range->SetInteger(kSettingPageRangeTo, 3);
base::ListValue* page_range_array = new base::ListValue();
- page_range_array->Append(page_range);
+ page_range_array->Append(std::move(page_range));
dict.Set(kSettingPageRange, page_range_array);
dict.SetBoolean(kSettingGenerateDraftData, false);
« no previous file with comments | « components/policy/core/common/schema_unittest.cc ('k') | components/search_engines/template_url_prepopulate_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698