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

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

Issue 9232075: Have ScopedClipboardWriter and Clipboard::WriteObjects take a buffer parameter. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Un-add myself to AUTHORS. Created 8 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
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/test/aura_shell_test_base.h" 7 #include "ash/test/aura_shell_test_base.h"
8 #include "ash/wm/root_window_event_filter.h" 8 #include "ash/wm/root_window_event_filter.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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 drag_view->num_drag_updates_); 398 drag_view->num_drag_updates_);
399 EXPECT_EQ(0, drag_view->num_drops_); 399 EXPECT_EQ(0, drag_view->num_drops_);
400 EXPECT_EQ(0, drag_view->num_drag_exits_); 400 EXPECT_EQ(0, drag_view->num_drag_exits_);
401 EXPECT_TRUE(drag_view->drag_done_received_); 401 EXPECT_TRUE(drag_view->drag_done_received_);
402 } 402 }
403 403
404 TEST_F(DragDropControllerTest, DragCopiesDataToClipboardTest) { 404 TEST_F(DragDropControllerTest, DragCopiesDataToClipboardTest) {
405 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard(); 405 ui::Clipboard* cb = views::ViewsDelegate::views_delegate->GetClipboard();
406 { 406 {
407 // We first clear the clipboard. 407 // We first clear the clipboard.
408 ui::ScopedClipboardWriter scw(cb); 408 ui::ScopedClipboardWriter scw(cb, ui::Clipboard::BUFFER_STANDARD);
409 scw.WriteWebSmartPaste(); 409 scw.WriteWebSmartPaste();
410 } 410 }
411 EXPECT_FALSE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(), 411 EXPECT_FALSE(cb->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
412 ui::Clipboard::BUFFER_STANDARD)); 412 ui::Clipboard::BUFFER_STANDARD));
413 std::string result; 413 std::string result;
414 cb->ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &result); 414 cb->ReadAsciiText(ui::Clipboard::BUFFER_STANDARD, &result);
415 EXPECT_EQ("", result); 415 EXPECT_EQ("", result);
416 416
417 scoped_ptr<views::Widget> widget(CreateNewWidget()); 417 scoped_ptr<views::Widget> widget(CreateNewWidget());
418 DragTestView* drag_view = new DragTestView; 418 DragTestView* drag_view = new DragTestView;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 EXPECT_EQ(1, drag_view->num_drag_enters_); 513 EXPECT_EQ(1, drag_view->num_drag_enters_);
514 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), 514 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
515 drag_view->num_drag_updates_); 515 drag_view->num_drag_updates_);
516 EXPECT_EQ(1, drag_view->num_drops_); 516 EXPECT_EQ(1, drag_view->num_drops_);
517 EXPECT_EQ(0, drag_view->num_drag_exits_); 517 EXPECT_EQ(0, drag_view->num_drag_exits_);
518 EXPECT_TRUE(drag_view->drag_done_received_); 518 EXPECT_TRUE(drag_view->drag_done_received_);
519 } 519 }
520 520
521 } // namespace test 521 } // namespace test
522 } // namespace aura 522 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_node_data.cc » ('j') | ui/base/clipboard/scoped_clipboard_writer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698