OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/os_exchange_data.h" | 5 #include "ui/base/dragdrop/os_exchange_data.h" |
6 #include "app/os_exchange_data_provider_win.h" | 6 #include "ui/base/dragdrop/os_exchange_data_provider_win.h" |
7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/scoped_handle.h" | 9 #include "base/scoped_handle.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/win/scoped_hglobal.h" | 12 #include "base/win/scoped_hglobal.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "ui/base/clipboard/clipboard_util_win.h" | 15 #include "ui/base/clipboard/clipboard_util_win.h" |
16 | 16 |
| 17 namespace ui { |
| 18 |
17 typedef testing::Test OSExchangeDataTest; | 19 typedef testing::Test OSExchangeDataTest; |
18 | 20 |
19 namespace { | 21 namespace { |
20 | 22 |
21 OSExchangeData::Provider* CloneProvider(const OSExchangeData& data) { | 23 OSExchangeData::Provider* CloneProvider(const OSExchangeData& data) { |
22 return new OSExchangeDataProviderWin( | 24 return new OSExchangeDataProviderWin( |
23 OSExchangeDataProviderWin::GetIDataObject(data)); | 25 OSExchangeDataProviderWin::GetIDataObject(data)); |
24 } | 26 } |
25 | 27 |
26 } // namespace | 28 } // namespace |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 OSExchangeData data; | 366 OSExchangeData data; |
365 data.SetString(L"http://google.com"); | 367 data.SetString(L"http://google.com"); |
366 | 368 |
367 OSExchangeData data2(CloneProvider(data)); | 369 OSExchangeData data2(CloneProvider(data)); |
368 ASSERT_TRUE(data2.HasURL()); | 370 ASSERT_TRUE(data2.HasURL()); |
369 GURL read_url; | 371 GURL read_url; |
370 std::wstring title; | 372 std::wstring title; |
371 EXPECT_TRUE(data2.GetURLAndTitle(&read_url, &title)); | 373 EXPECT_TRUE(data2.GetURLAndTitle(&read_url, &title)); |
372 EXPECT_EQ(GURL("http://google.com"), read_url); | 374 EXPECT_EQ(GURL("http://google.com"), read_url); |
373 } | 375 } |
| 376 |
| 377 } // namespace ui |
OLD | NEW |