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

Side by Side Diff: ui/views/controls/textfield/native_textfield_views_unittest.cc

Issue 11444013: Get drag and drop working for win aura. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years 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
« no previous file with comments | « ui/ui.gyp ('k') | ui/views/views.gyp » ('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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE); 866 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE);
867 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE, 867 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE,
868 textfield_view_->OnDragUpdated(drop)); 868 textfield_view_->OnDragUpdated(drop));
869 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, textfield_view_->OnPerformDrop(drop)); 869 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, textfield_view_->OnPerformDrop(drop));
870 EXPECT_STR_EQ("hello string world", textfield_->text()); 870 EXPECT_STR_EQ("hello string world", textfield_->text());
871 871
872 // Ensure that textfields do not accept non-OSExchangeData::STRING types. 872 // Ensure that textfields do not accept non-OSExchangeData::STRING types.
873 ui::OSExchangeData bad_data; 873 ui::OSExchangeData bad_data;
874 bad_data.SetFilename(FilePath(FILE_PATH_LITERAL("x"))); 874 bad_data.SetFilename(FilePath(FILE_PATH_LITERAL("x")));
875 #if defined(OS_WIN) 875 #if defined(OS_WIN)
876 #if defined(USE_AURA)
877 ui::OSExchangeData::CustomFormat fmt = ui::Clipboard::GetBitmapFormatType();
878 #else
879 ui::OSExchangeData::CustomFormat fmt = CF_BITMAP; 876 ui::OSExchangeData::CustomFormat fmt = CF_BITMAP;
880 #endif
881 bad_data.SetPickledData(fmt, Pickle()); 877 bad_data.SetPickledData(fmt, Pickle());
882 bad_data.SetFileContents(FilePath(L"x"), "x"); 878 bad_data.SetFileContents(FilePath(L"x"), "x");
883 bad_data.SetHtml(string16(ASCIIToUTF16("x")), GURL("x.org")); 879 bad_data.SetHtml(string16(ASCIIToUTF16("x")), GURL("x.org"));
884 ui::OSExchangeData::DownloadFileInfo download(FilePath(), NULL); 880 ui::OSExchangeData::DownloadFileInfo download(FilePath(), NULL);
885 bad_data.SetDownloadFileInfo(download); 881 bad_data.SetDownloadFileInfo(download);
886 #endif 882 #endif
887 EXPECT_FALSE(textfield_view_->CanDrop(bad_data)); 883 EXPECT_FALSE(textfield_view_->CanDrop(bad_data));
888 } 884 }
889 #endif 885 #endif
890 886
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 EXPECT_EQ(char_rect[i], actual_rect) << " i=" << i; 1673 EXPECT_EQ(char_rect[i], actual_rect) << " i=" << i;
1678 } 1674 }
1679 1675
1680 // Return false if the index is out of range. 1676 // Return false if the index is out of range.
1681 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count, &rect)); 1677 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count, &rect));
1682 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 1, &rect)); 1678 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 1, &rect));
1683 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 100, &rect)); 1679 EXPECT_FALSE(client->GetCompositionCharacterBounds(char_count + 100, &rect));
1684 } 1680 }
1685 1681
1686 } // namespace views 1682 } // namespace views
OLDNEW
« no previous file with comments | « ui/ui.gyp ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698