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

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

Issue 12041078: Clear the clipboard closing Incognito window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge and compilation fixes 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
« 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, objects); 363 clipboard().WriteObjects(Clipboard::BUFFER_STANDARD,
364 objects,
365 Clipboard::SourceTag());
364 366
365 EXPECT_TRUE(clipboard().IsFormatAvailable(Clipboard::GetBitmapFormatType(), 367 EXPECT_TRUE(clipboard().IsFormatAvailable(Clipboard::GetBitmapFormatType(),
366 Clipboard::BUFFER_STANDARD)); 368 Clipboard::BUFFER_STANDARD));
367 } 369 }
368 #endif 370 #endif
369 371
370 // The following test somehow fails on GTK. The image when read back from the 372 // The following test somehow fails on GTK. The image when read back from the
371 // clipboard has the alpha channel set to 0xFF for some reason. The other 373 // clipboard has the alpha channel set to 0xFF for some reason. The other
372 // channels stay intact. So I am turning this on only for aura. 374 // channels stay intact. So I am turning this on only for aura.
373 // 375 //
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 EXPECT_TRUE(clipboard().IsFormatAvailable( 689 EXPECT_TRUE(clipboard().IsFormatAvailable(
688 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD)); 690 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD));
689 691
690 // Make sure the text is what we inserted while simulating the other app 692 // Make sure the text is what we inserted while simulating the other app
691 std::string contents; 693 std::string contents;
692 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents); 694 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents);
693 EXPECT_EQ(contents, new_value); 695 EXPECT_EQ(contents, new_value);
694 } 696 }
695 #endif 697 #endif
696 } // namespace ui 698 } // 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