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

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

Issue 10911074: Change how ui::Clipboard is accessed so there's only one per thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: views_delegate.h deletion Created 8 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 | Annotate | Revision Log
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/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 EXPECT_EQ(1, drag_view->num_drag_enters_); 497 EXPECT_EQ(1, drag_view->num_drag_enters_);
498 EXPECT_EQ(num_drags_1 - 1 - drag_view->VerticalDragThreshold(), 498 EXPECT_EQ(num_drags_1 - 1 - drag_view->VerticalDragThreshold(),
499 drag_view->num_drag_updates_); 499 drag_view->num_drag_updates_);
500 EXPECT_EQ(0, drag_view->num_drops_); 500 EXPECT_EQ(0, drag_view->num_drops_);
501 EXPECT_EQ(0, drag_view->num_drag_exits_); 501 EXPECT_EQ(0, drag_view->num_drag_exits_);
502 EXPECT_TRUE(drag_view->drag_done_received_); 502 EXPECT_TRUE(drag_view->drag_done_received_);
503 } 503 }
504 504
505 TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) { 505 TEST_F(DragDropControllerTest, DragLeavesClipboardAloneTest) {
506 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard(); 506 ui::Clipboard* cb = ui::Clipboard::GetForCurrentThread();
507 std::string clip_str("I am on the clipboard"); 507 std::string clip_str("I am on the clipboard");
508 { 508 {
509 // We first copy some text to the clipboard. 509 // We first copy some text to the clipboard.
510 ui::ScopedClipboardWriter scw(cb, ui::Clipboard::BUFFER_STANDARD); 510 ui::ScopedClipboardWriter scw(cb, ui::Clipboard::BUFFER_STANDARD);
511 scw.WriteText(ASCIIToUTF16(clip_str)); 511 scw.WriteText(ASCIIToUTF16(clip_str));
512 } 512 }
513 EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), 513 EXPECT_TRUE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
514 ui::Clipboard::BUFFER_STANDARD)); 514 ui::Clipboard::BUFFER_STANDARD));
515 515
516 scoped_ptr<views::Widget> widget(CreateNewWidget()); 516 scoped_ptr<views::Widget> widget(CreateNewWidget());
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 EXPECT_EQ(1, drag_view->num_drag_enters_); 667 EXPECT_EQ(1, drag_view->num_drag_enters_);
668 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), 668 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
669 drag_view->num_drag_updates_); 669 drag_view->num_drag_updates_);
670 EXPECT_EQ(0, drag_view->num_drops_); 670 EXPECT_EQ(0, drag_view->num_drops_);
671 EXPECT_EQ(1, drag_view->num_drag_exits_); 671 EXPECT_EQ(1, drag_view->num_drag_exits_);
672 EXPECT_TRUE(drag_view->drag_done_received_); 672 EXPECT_TRUE(drag_view->drag_done_received_);
673 } 673 }
674 674
675 } // namespace test 675 } // namespace test
676 } // namespace aura 676 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_node_data.cc » ('j') | chrome/browser/bookmarks/bookmark_node_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698