OLD | NEW |
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 "ash/wm/root_window_event_filter.h" | 9 #include "ash/wm/root_window_event_filter.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 drag_view->num_drag_updates_); | 401 drag_view->num_drag_updates_); |
402 EXPECT_EQ(0, drag_view->num_drops_); | 402 EXPECT_EQ(0, drag_view->num_drops_); |
403 EXPECT_EQ(0, drag_view->num_drag_exits_); | 403 EXPECT_EQ(0, drag_view->num_drag_exits_); |
404 EXPECT_TRUE(drag_view->drag_done_received_); | 404 EXPECT_TRUE(drag_view->drag_done_received_); |
405 } | 405 } |
406 | 406 |
407 TEST_F(DragDropControllerTest, DragCopiesDataToClipboardTest) { | 407 TEST_F(DragDropControllerTest, DragCopiesDataToClipboardTest) { |
408 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard(); | 408 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard(); |
409 { | 409 { |
410 // We first clear the clipboard. | 410 // We first clear the clipboard. |
411 ui::ScopedClipboardWriter scw(cb); | 411 ui::ScopedClipboardWriter scw(cb, ui::Clipboard::BUFFER_STANDARD); |
412 scw.WriteWebSmartPaste(); | 412 scw.WriteWebSmartPaste(); |
413 } | 413 } |
414 EXPECT_FALSE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), | 414 EXPECT_FALSE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), |
415 ui::Clipboard::BUFFER_STANDARD)); | 415 ui::Clipboard::BUFFER_STANDARD)); |
416 std::string result; | 416 std::string result; |
417 cb->ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &result); | 417 cb->ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &result); |
418 EXPECT_EQ("", result); | 418 EXPECT_EQ("", result); |
419 | 419 |
420 scoped_ptr<views::Widget> widget(CreateNewWidget()); | 420 scoped_ptr<views::Widget> widget(CreateNewWidget()); |
421 DragTestView* drag_view = new DragTestView; | 421 DragTestView* drag_view = new DragTestView; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 EXPECT_EQ(1, drag_view->num_drag_enters_); | 519 EXPECT_EQ(1, drag_view->num_drag_enters_); |
520 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), | 520 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), |
521 drag_view->num_drag_updates_); | 521 drag_view->num_drag_updates_); |
522 EXPECT_EQ(1, drag_view->num_drops_); | 522 EXPECT_EQ(1, drag_view->num_drops_); |
523 EXPECT_EQ(0, drag_view->num_drag_exits_); | 523 EXPECT_EQ(0, drag_view->num_drag_exits_); |
524 EXPECT_TRUE(drag_view->drag_done_received_); | 524 EXPECT_TRUE(drag_view->drag_done_received_); |
525 } | 525 } |
526 | 526 |
527 } // namespace test | 527 } // namespace test |
528 } // namespace aura | 528 } // namespace aura |
OLD | NEW |