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

Unified Diff: base/i18n/message_formatter_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/i18n/message_formatter.h ('k') | base/i18n/number_formatting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/message_formatter_unittest.cc
diff --git a/base/i18n/message_formatter_unittest.cc b/base/i18n/message_formatter_unittest.cc
index 85e2e171cb11560718338b93414fadc5a91f9620..a6f461370c7ffaef00f5971f63ca09139060f4d4 100644
--- a/base/i18n/message_formatter_unittest.cc
+++ b/base/i18n/message_formatter_unittest.cc
@@ -4,8 +4,9 @@
#include "base/i18n/message_formatter.h"
+#include <memory>
+
#include "base/i18n/rtl.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -36,8 +37,9 @@ class MessageFormatterTest : public testing::Test {
namespace {
-void AppendFormattedDateTime(const scoped_ptr<icu::DateFormat>& df,
- const Time& now, std::string* result) {
+void AppendFormattedDateTime(const std::unique_ptr<icu::DateFormat>& df,
+ const Time& now,
+ std::string* result) {
icu::UnicodeString formatted;
df->format(static_cast<UDate>(now.ToJsTime()), formatted).
toUTF8String(*result);
@@ -119,7 +121,8 @@ TEST_F(MessageFormatterTest, PluralNumberedArgsWithDate) {
base::Time now = base::Time::Now();
using icu::DateFormat;
- scoped_ptr<DateFormat> df(DateFormat::createDateInstance(DateFormat::FULL));
+ std::unique_ptr<DateFormat> df(
+ DateFormat::createDateInstance(DateFormat::FULL));
std::string second_sentence = " Today is ";
AppendFormattedDateTime(df, now, &second_sentence);
@@ -141,8 +144,10 @@ TEST_F(MessageFormatterTest, DateTimeAndNumber) {
"The speed of the wind was {3,number,###.#} mph.");
using icu::DateFormat;
- scoped_ptr<DateFormat> tf(DateFormat::createTimeInstance(DateFormat::SHORT));
- scoped_ptr<DateFormat> df(DateFormat::createDateInstance(DateFormat::MEDIUM));
+ std::unique_ptr<DateFormat> tf(
+ DateFormat::createTimeInstance(DateFormat::SHORT));
+ std::unique_ptr<DateFormat> df(
+ DateFormat::createDateInstance(DateFormat::MEDIUM));
base::Time now = base::Time::Now();
std::string expected = "At ";
« no previous file with comments | « base/i18n/message_formatter.h ('k') | base/i18n/number_formatting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698