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

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

Issue 496473003: Add ui_unittests to GN build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/BUILD.gn ('k') | ui/ui_unittests.gyp » ('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 (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_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/win/scoped_hglobal.h" 8 #include "base/win/scoped_hglobal.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/base/clipboard/clipboard.h" 10 #include "ui/base/clipboard/clipboard.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 EXPECT_EQ(S_OK, com_data->SetData(&format_etc, &medium, TRUE)); 59 EXPECT_EQ(S_OK, com_data->SetData(&format_etc, &medium, TRUE));
60 60
61 // Construct a new object with the old object so that we can use our access 61 // Construct a new object with the old object so that we can use our access
62 // APIs. 62 // APIs.
63 OSExchangeData data2(data.provider().Clone()); 63 OSExchangeData data2(data.provider().Clone());
64 EXPECT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES)); 64 EXPECT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES));
65 GURL url_from_data; 65 GURL url_from_data;
66 std::wstring title; 66 std::wstring title;
67 EXPECT_TRUE(data2.GetURLAndTitle( 67 EXPECT_TRUE(data2.GetURLAndTitle(
68 OSExchangeData::CONVERT_FILENAMES, &url_from_data, &title)); 68 OSExchangeData::CONVERT_FILENAMES, &url_from_data, &title));
69 GURL reference_url(in put); 69 GURL reference_url(input);
70 EXPECT_EQ(reference_url.spec(), url_from_data.spec()); 70 EXPECT_EQ(reference_url.spec(), url_from_data.spec());
71 } 71 }
72 72
73 // Verifies SetData invoked twice with the same data clobbers existing data. 73 // Verifies SetData invoked twice with the same data clobbers existing data.
74 TEST(OSExchangeDataWinTest, RemoveData) { 74 TEST(OSExchangeDataWinTest, RemoveData) {
75 OSExchangeData data; 75 OSExchangeData data;
76 std::wstring input = L"http://www.google.com/"; 76 std::wstring input = L"http://www.google.com/";
77 std::wstring input2 = L"http://www.google2.com/"; 77 std::wstring input2 = L"http://www.google2.com/";
78 78
79 base::win::ScopedComPtr<IDataObject> com_data( 79 base::win::ScopedComPtr<IDataObject> com_data(
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 OSExchangeData data2(data.provider().Clone()); 348 OSExchangeData data2(data.provider().Clone());
349 ASSERT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES)); 349 ASSERT_TRUE(data2.HasURL(OSExchangeData::CONVERT_FILENAMES));
350 GURL read_url; 350 GURL read_url;
351 std::wstring title; 351 std::wstring title;
352 EXPECT_TRUE(data2.GetURLAndTitle( 352 EXPECT_TRUE(data2.GetURLAndTitle(
353 OSExchangeData::CONVERT_FILENAMES, &read_url, &title)); 353 OSExchangeData::CONVERT_FILENAMES, &read_url, &title));
354 EXPECT_EQ(GURL("http://google.com"), read_url); 354 EXPECT_EQ(GURL("http://google.com"), read_url);
355 } 355 }
356 356
357 } // namespace ui 357 } // namespace ui
OLDNEW
« no previous file with comments | « ui/BUILD.gn ('k') | ui/ui_unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698