OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/base/dragdrop/os_exchange_data.h" |
| 6 |
| 7 #include <memory> |
| 8 |
5 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
6 #include "base/memory/scoped_ptr.h" | |
7 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
8 #include "base/win/scoped_hglobal.h" | 11 #include "base/win/scoped_hglobal.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
11 #include "ui/base/dragdrop/os_exchange_data.h" | |
12 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" | 14 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
13 #include "url/gurl.h" | 15 #include "url/gurl.h" |
14 | 16 |
15 namespace ui { | 17 namespace ui { |
16 | 18 |
17 // Test getting using the IDataObject COM API | 19 // Test getting using the IDataObject COM API |
18 TEST(OSExchangeDataWinTest, StringDataAccessViaCOM) { | 20 TEST(OSExchangeDataWinTest, StringDataAccessViaCOM) { |
19 OSExchangeData data; | 21 OSExchangeData data; |
20 std::wstring input = L"O hai googlz."; | 22 std::wstring input = L"O hai googlz."; |
21 data.SetString(input); | 23 data.SetString(input); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 OSExchangeData data2(data.provider().Clone()); | 344 OSExchangeData data2(data.provider().Clone()); |
343 ASSERT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES)); | 345 ASSERT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES)); |
344 GURL read_url; | 346 GURL read_url; |
345 std::wstring title; | 347 std::wstring title; |
346 EXPECT_TRUE(data2.GetURLAndTitle( | 348 EXPECT_TRUE(data2.GetURLAndTitle( |
347 OSExchangeData::CONVERT_FILENAMES, &read_url, &title)); | 349 OSExchangeData::CONVERT_FILENAMES, &read_url, &title)); |
348 EXPECT_EQ(GURL("http://google.com"), read_url); | 350 EXPECT_EQ(GURL("http://google.com"), read_url); |
349 } | 351 } |
350 | 352 |
351 } // namespace ui | 353 } // namespace ui |
OLD | NEW |