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

Unified Diff: third_party/WebKit/Source/platform/text/LocaleWinTest.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: third_party/WebKit/Source/platform/text/LocaleWinTest.cpp
diff --git a/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp b/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp
index 70930c09c0708f4d9b52f57528f40aa76d6cba91..898fe5bf5d456fa0559c22d5e395c15f534317e9 100644
--- a/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp
+++ b/third_party/WebKit/Source/platform/text/LocaleWinTest.cpp
@@ -34,8 +34,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/DateMath.h"
#include "wtf/MathExtras.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/text/CString.h"
-#include <memory>
namespace blink {
@@ -84,67 +84,67 @@ protected:
String formatDate(LCID lcid, int year, int month, int day)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->formatDateTime(getDateComponents(year, month, day));
}
unsigned firstDayOfWeek(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->firstDayOfWeek();
}
String monthLabel(LCID lcid, unsigned index)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->monthLabels()[index];
}
String weekDayShortLabel(LCID lcid, unsigned index)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->weekDayShortLabels()[index];
}
bool isRTL(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->isRTL();
}
String monthFormat(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->monthFormat();
}
String timeFormat(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->timeFormat();
}
String shortTimeFormat(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->shortTimeFormat();
}
String shortMonthLabel(LCID lcid, unsigned index)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->shortMonthLabels()[index];
}
String timeAMPMLabel(LCID lcid, unsigned index)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->timeAMPMLabels()[index];
}
String decimalSeparator(LCID lcid)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
return locale->localizedDecimalSeparator();
}
};
@@ -261,7 +261,7 @@ TEST_F(LocaleWinTest, decimalSeparator)
static void testNumberIsReversible(LCID lcid, const char* original, const char* shouldHave = 0)
{
- std::unique_ptr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
+ OwnPtr<LocaleWin> locale = LocaleWin::create(lcid, true /* defaultsForLocale */);
String localized = locale->convertToLocalizedNumber(original);
if (shouldHave)
EXPECT_TRUE(localized.contains(shouldHave));
« no previous file with comments | « third_party/WebKit/Source/platform/text/LocaleWin.cpp ('k') | third_party/WebKit/Source/platform/text/PlatformLocale.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698