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

Side by Side Diff: ui/base/clipboard/clipboard_unittest.cc

Issue 12298037: Revert 183123 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1417/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/clipboard/clipboard_mac.mm ('k') | ui/base/clipboard/clipboard_util_win.h » ('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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 size_param.push_back(size_data[i]); 353 size_param.push_back(size_data[i]);
354 354
355 Clipboard::ObjectMapParams params; 355 Clipboard::ObjectMapParams params;
356 params.push_back(placeholder_param); 356 params.push_back(placeholder_param);
357 params.push_back(size_param); 357 params.push_back(size_param);
358 358
359 Clipboard::ObjectMap objects; 359 Clipboard::ObjectMap objects;
360 objects[Clipboard::CBF_SMBITMAP] = params; 360 objects[Clipboard::CBF_SMBITMAP] = params;
361 Clipboard::ReplaceSharedMemHandle(&objects, handle_to_share, current_process); 361 Clipboard::ReplaceSharedMemHandle(&objects, handle_to_share, current_process);
362 362
363 clipboard().WriteObjects(Clipboard::BUFFER_STANDARD, 363 clipboard().WriteObjects(Clipboard::BUFFER_STANDARD, objects);
364 objects,
365 Clipboard::SourceTag());
366 364
367 EXPECT_TRUE(clipboard().IsFormatAvailable(Clipboard::GetBitmapFormatType(), 365 EXPECT_TRUE(clipboard().IsFormatAvailable(Clipboard::GetBitmapFormatType(),
368 Clipboard::BUFFER_STANDARD)); 366 Clipboard::BUFFER_STANDARD));
369 } 367 }
370 #endif 368 #endif
371 369
372 // The following test somehow fails on GTK. The image when read back from the 370 // The following test somehow fails on GTK. The image when read back from the
373 // clipboard has the alpha channel set to 0xFF for some reason. The other 371 // clipboard has the alpha channel set to 0xFF for some reason. The other
374 // channels stay intact. So I am turning this on only for aura. 372 // channels stay intact. So I am turning this on only for aura.
375 // 373 //
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 EXPECT_TRUE(clipboard().IsFormatAvailable( 687 EXPECT_TRUE(clipboard().IsFormatAvailable(
690 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD)); 688 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD));
691 689
692 // Make sure the text is what we inserted while simulating the other app 690 // Make sure the text is what we inserted while simulating the other app
693 std::string contents; 691 std::string contents;
694 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents); 692 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents);
695 EXPECT_EQ(contents, new_value); 693 EXPECT_EQ(contents, new_value);
696 } 694 }
697 #endif 695 #endif
698 } // namespace ui 696 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_mac.mm ('k') | ui/base/clipboard/clipboard_util_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698