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

Side by Side Diff: ui/base/dragdrop/os_exchange_data_unittest.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 unified diff | Download patch
« no previous file with comments | « ui/base/dragdrop/os_exchange_data.h ('k') | ui/base/dragdrop/os_exchange_data_win_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/files/file_util.h" 5 #include "base/files/file_util.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "net/base/filename_util.h" 10 #include "net/base/filename_util.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
13 #include "ui/base/dragdrop/os_exchange_data.h" 13 #include "ui/base/dragdrop/os_exchange_data.h"
14 #include "ui/events/platform/platform_event_source.h" 14 #include "ui/events/platform/platform_event_source.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 namespace ui { 17 namespace ui {
18 18
19 class OSExchangeDataTest : public PlatformTest { 19 class OSExchangeDataTest : public PlatformTest {
20 public: 20 public:
21 OSExchangeDataTest() 21 OSExchangeDataTest()
22 : event_source_(ui::PlatformEventSource::CreateDefault()) {} 22 : event_source_(ui::PlatformEventSource::CreateDefault()) {}
23 23
24 private: 24 private:
25 base::MessageLoopForUI message_loop_; 25 base::MessageLoopForUI message_loop_;
26 scoped_ptr<PlatformEventSource> event_source_; 26 std::unique_ptr<PlatformEventSource> event_source_;
27 }; 27 };
28 28
29 TEST_F(OSExchangeDataTest, StringDataGetAndSet) { 29 TEST_F(OSExchangeDataTest, StringDataGetAndSet) {
30 OSExchangeData data; 30 OSExchangeData data;
31 base::string16 input = base::ASCIIToUTF16("I can has cheezburger?"); 31 base::string16 input = base::ASCIIToUTF16("I can has cheezburger?");
32 EXPECT_FALSE(data.HasString()); 32 EXPECT_FALSE(data.HasString());
33 data.SetString(input); 33 data.SetString(input);
34 EXPECT_TRUE(data.HasString()); 34 EXPECT_TRUE(data.HasString());
35 35
36 OSExchangeData data2(data.provider().Clone()); 36 OSExchangeData data2(data.provider().Clone());
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 data.SetHtml(html, url); 178 data.SetHtml(html, url);
179 179
180 OSExchangeData copy(data.provider().Clone()); 180 OSExchangeData copy(data.provider().Clone());
181 base::string16 read_html; 181 base::string16 read_html;
182 EXPECT_TRUE(copy.GetHtml(&read_html, &url)); 182 EXPECT_TRUE(copy.GetHtml(&read_html, &url));
183 EXPECT_EQ(html, read_html); 183 EXPECT_EQ(html, read_html);
184 } 184 }
185 #endif 185 #endif
186 186
187 } // namespace ui 187 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data.h ('k') | ui/base/dragdrop/os_exchange_data_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698