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

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

Issue 12217101: Replace FilePath with base::FilePath in some more top level directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/l10n/l10n_util_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 (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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 int value; 354 int value;
355 EXPECT_TRUE(restored_pickle.ReadInt(&iterator, &value)); 355 EXPECT_TRUE(restored_pickle.ReadInt(&iterator, &value));
356 EXPECT_EQ(1, value); 356 EXPECT_EQ(1, value);
357 EXPECT_TRUE(restored_pickle.ReadInt(&iterator, &value)); 357 EXPECT_TRUE(restored_pickle.ReadInt(&iterator, &value));
358 EXPECT_EQ(2, value); 358 EXPECT_EQ(2, value);
359 } 359 }
360 360
361 TEST(OSExchangeDataTest, FileContents) { 361 TEST(OSExchangeDataTest, FileContents) {
362 OSExchangeData data; 362 OSExchangeData data;
363 std::string file_contents("data\0with\0nulls", 15); 363 std::string file_contents("data\0with\0nulls", 15);
364 data.SetFileContents(FilePath(L"filename.txt"), file_contents); 364 data.SetFileContents(base::FilePath(L"filename.txt"), file_contents);
365 365
366 OSExchangeData copy(CloneProvider(data)); 366 OSExchangeData copy(CloneProvider(data));
367 FilePath filename; 367 base::FilePath filename;
368 std::string read_contents; 368 std::string read_contents;
369 EXPECT_TRUE(copy.GetFileContents(&filename, &read_contents)); 369 EXPECT_TRUE(copy.GetFileContents(&filename, &read_contents));
370 EXPECT_EQ(L"filename.txt", filename.value()); 370 EXPECT_EQ(L"filename.txt", filename.value());
371 EXPECT_EQ(file_contents, read_contents); 371 EXPECT_EQ(file_contents, read_contents);
372 } 372 }
373 373
374 TEST(OSExchangeDataTest, Html) { 374 TEST(OSExchangeDataTest, Html) {
375 OSExchangeData data; 375 OSExchangeData data;
376 GURL url("http://www.google.com/"); 376 GURL url("http://www.google.com/");
377 std::wstring html( 377 std::wstring html(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/l10n/l10n_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698