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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "base/memory/scoped_handle.h" | 6 #include "base/memory/scoped_handle.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/win/scoped_hglobal.h" | 10 #include "base/win/scoped_hglobal.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 EXPECT_EQ(1, retrieved); | 289 EXPECT_EQ(1, retrieved); |
290 EXPECT_EQ(text_x_moz_url, elements_array[0].cfFormat); | 290 EXPECT_EQ(text_x_moz_url, elements_array[0].cfFormat); |
291 } | 291 } |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 TEST(OSExchangeDataTest, TestURLExchangeFormats) { | 295 TEST(OSExchangeDataTest, TestURLExchangeFormats) { |
296 OSExchangeData data; | 296 OSExchangeData data; |
297 std::string url_spec = "http://www.google.com/"; | 297 std::string url_spec = "http://www.google.com/"; |
298 GURL url(url_spec); | 298 GURL url(url_spec); |
299 std::wstring url_title = L"Google"; | 299 std::wstring url_title = L"www.google.com"; |
300 data.SetURL(url, url_title); | 300 data.SetURL(url, url_title); |
301 std::wstring output; | 301 std::wstring output; |
302 | 302 |
303 OSExchangeData data2(CloneProvider(data)); | 303 OSExchangeData data2(CloneProvider(data)); |
304 | 304 |
305 // URL spec and title should match | 305 // URL spec and title should match |
306 GURL output_url; | 306 GURL output_url; |
307 std::wstring output_title; | 307 std::wstring output_title; |
308 EXPECT_TRUE(data2.GetURLAndTitle(&output_url, &output_title)); | 308 EXPECT_TRUE(data2.GetURLAndTitle(&output_url, &output_title)); |
309 EXPECT_EQ(url_spec, output_url.spec()); | 309 EXPECT_EQ(url_spec, output_url.spec()); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 416 |
417 OSExchangeData data2(CloneProvider(data)); | 417 OSExchangeData data2(CloneProvider(data)); |
418 ASSERT_TRUE(data2.HasURL()); | 418 ASSERT_TRUE(data2.HasURL()); |
419 GURL read_url; | 419 GURL read_url; |
420 std::wstring title; | 420 std::wstring title; |
421 EXPECT_TRUE(data2.GetURLAndTitle(&read_url, &title)); | 421 EXPECT_TRUE(data2.GetURLAndTitle(&read_url, &title)); |
422 EXPECT_EQ(GURL("http://google.com"), read_url); | 422 EXPECT_EQ(GURL("http://google.com"), read_url); |
423 } | 423 } |
424 | 424 |
425 } // namespace ui | 425 } // namespace ui |
OLD | NEW |