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

Unified Diff: ui/base/dragdrop/os_exchange_data_unittest.cc

Issue 2179813003: Allow OSExchangeData::Provider to be overridden at run time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac + win Created 4 years, 5 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 | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/dragdrop/os_exchange_data_unittest.cc
diff --git a/ui/base/dragdrop/os_exchange_data_unittest.cc b/ui/base/dragdrop/os_exchange_data_unittest.cc
index e26d66d920145d0dd8eb9fcaae4fb5048d871be6..b1425f161efefbb186ff30a7a0f9075b02838cb2 100644
--- a/ui/base/dragdrop/os_exchange_data_unittest.cc
+++ b/ui/base/dragdrop/os_exchange_data_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "base/files/file_util.h"
#include "base/message_loop/message_loop.h"
#include "base/pickle.h"
@@ -33,7 +35,8 @@ TEST_F(OSExchangeDataTest, StringDataGetAndSet) {
data.SetString(input);
EXPECT_TRUE(data.HasString());
- OSExchangeData data2(data.provider().Clone());
+ OSExchangeData data2(
+ std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone()));
base::string16 output;
EXPECT_TRUE(data2.HasString());
EXPECT_TRUE(data2.GetString(&output));
@@ -56,7 +59,8 @@ TEST_F(OSExchangeDataTest, TestURLExchangeFormats) {
data.SetURL(url, url_title);
EXPECT_TRUE(data.HasURL(OSExchangeData::DO_NOT_CONVERT_FILENAMES));
- OSExchangeData data2(data.provider().Clone());
+ OSExchangeData data2(
+ std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone()));
// URL spec and title should match
GURL output_url;
@@ -144,7 +148,8 @@ TEST_F(OSExchangeDataTest, TestPickledData) {
OSExchangeData data;
data.SetPickledData(kTestFormat, saved_pickle);
- OSExchangeData copy(data.provider().Clone());
+ OSExchangeData copy(
+ std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone()));
EXPECT_TRUE(copy.HasCustomFormat(kTestFormat));
base::Pickle restored_pickle;
@@ -167,7 +172,8 @@ TEST_F(OSExchangeDataTest, TestHTML) {
"</BODY>\n</HTML>");
data.SetHtml(html, url);
- OSExchangeData copy(data.provider().Clone());
+ OSExchangeData copy(
+ std::unique_ptr<OSExchangeData::Provider>(data.provider().Clone()));
base::string16 read_html;
EXPECT_TRUE(copy.GetHtml(&read_html, &url));
EXPECT_EQ(html, read_html);
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698