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

Side by Side Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 558913003: Remove clipboard argument from ScopedClipboardWriter constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't leak a clipboard on Windows Created 6 years, 3 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 | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu.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 "ash/drag_drop/drag_drop_controller.h" 5 #include "ash/drag_drop/drag_drop_controller.h"
6 6
7 #include "ash/drag_drop/drag_drop_tracker.h" 7 #include "ash/drag_drop/drag_drop_tracker.h"
8 #include "ash/drag_drop/drag_image_view.h" 8 #include "ash/drag_drop/drag_image_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 EXPECT_EQ(0, drag_view->num_drops_); 621 EXPECT_EQ(0, drag_view->num_drops_);
622 EXPECT_EQ(0, drag_view->num_drag_exits_); 622 EXPECT_EQ(0, drag_view->num_drag_exits_);
623 EXPECT_TRUE(drag_view->drag_done_received_); 623 EXPECT_TRUE(drag_view->drag_done_received_);
624 } 624 }
625 625
626 TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) { 626 TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) {
627 ui::Clipboard* cb = ui::Clipboard::GetForCurrentThread(); 627 ui::Clipboard* cb = ui::Clipboard::GetForCurrentThread();
628 std::string clip_str("I am on the clipboard"); 628 std::string clip_str("I am on the clipboard");
629 { 629 {
630 // We first copy some text to the clipboard. 630 // We first copy some text to the clipboard.
631 ui::ScopedClipboardWriter scw(cb, ui::CLIPBOARD_TYPE_COPY_PASTE); 631 ui::ScopedClipboardWriter scw(ui::CLIPBOARD_TYPE_COPY_PASTE);
632 scw.WriteText(base::ASCIIToUTF16(clip_str)); 632 scw.WriteText(base::ASCIIToUTF16(clip_str));
633 } 633 }
634 EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), 634 EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
635 ui::CLIPBOARD_TYPE_COPY_PASTE)); 635 ui::CLIPBOARD_TYPE_COPY_PASTE));
636 636
637 scoped_ptr<views::Widget> widget(CreateNewWidget()); 637 scoped_ptr<views::Widget> widget(CreateNewWidget());
638 DragTestView* drag_view = new DragTestView; 638 DragTestView* drag_view = new DragTestView;
639 AddViewToWidgetAndResize(widget.get(), drag_view); 639 AddViewToWidgetAndResize(widget.get(), drag_view);
640 640
641 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), 641 ui::test::EventGenerator generator(Shell::GetPrimaryRootWindow(),
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); 1075 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString());
1076 } 1076 }
1077 for (aura::Window::Windows::iterator iter = root_windows.begin(); 1077 for (aura::Window::Windows::iterator iter = root_windows.begin();
1078 iter != root_windows.end(); ++iter) { 1078 iter != root_windows.end(); ++iter) {
1079 aura::client::SetDragDropClient(*iter, NULL); 1079 aura::client::SetDragDropClient(*iter, NULL);
1080 } 1080 }
1081 } 1081 }
1082 1082
1083 } // namespace test 1083 } // namespace test
1084 } // namespace aura 1084 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_context_menu/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698