| 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 <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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE, | 859 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_MOVE, |
| 860 textfield_view_->OnDragUpdated(drop)); | 860 textfield_view_->OnDragUpdated(drop)); |
| 861 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, textfield_view_->OnPerformDrop(drop)); | 861 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, textfield_view_->OnPerformDrop(drop)); |
| 862 EXPECT_STR_EQ("hello string world", textfield_->text()); | 862 EXPECT_STR_EQ("hello string world", textfield_->text()); |
| 863 | 863 |
| 864 // Ensure that textfields do not accept non-OSExchangeData::STRING types. | 864 // Ensure that textfields do not accept non-OSExchangeData::STRING types. |
| 865 ui::OSExchangeData bad_data; | 865 ui::OSExchangeData bad_data; |
| 866 bad_data.SetFilename(FilePath(FILE_PATH_LITERAL("x"))); | 866 bad_data.SetFilename(FilePath(FILE_PATH_LITERAL("x"))); |
| 867 #if defined(OS_WIN) | 867 #if defined(OS_WIN) |
| 868 #if defined(USE_AURA) | 868 #if defined(USE_AURA) |
| 869 ui::OSExchangeData::CustomFormat fmt = ui::Clipboard::GetBitmapFormatType(); | 869 ui::OSExchangeData::CustomFormat fmt = ui::Clipboard::GetImageFormatType(); |
| 870 #else | 870 #else |
| 871 ui::OSExchangeData::CustomFormat fmt = CF_BITMAP; | 871 ui::OSExchangeData::CustomFormat fmt = CF_BITMAP; |
| 872 #endif | 872 #endif |
| 873 bad_data.SetPickledData(fmt, Pickle()); | 873 bad_data.SetPickledData(fmt, Pickle()); |
| 874 bad_data.SetFileContents(FilePath(L"x"), "x"); | 874 bad_data.SetFileContents(FilePath(L"x"), "x"); |
| 875 bad_data.SetHtml(string16(ASCIIToUTF16("x")), GURL("x.org")); | 875 bad_data.SetHtml(string16(ASCIIToUTF16("x")), GURL("x.org")); |
| 876 ui::OSExchangeData::DownloadFileInfo download(FilePath(), NULL); | 876 ui::OSExchangeData::DownloadFileInfo download(FilePath(), NULL); |
| 877 bad_data.SetDownloadFileInfo(download); | 877 bad_data.SetDownloadFileInfo(download); |
| 878 #endif | 878 #endif |
| 879 EXPECT_FALSE(textfield_view_->CanDrop(bad_data)); | 879 EXPECT_FALSE(textfield_view_->CanDrop(bad_data)); |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 #else | 1652 #else |
| 1653 EXPECT_EQ(500U, textfield_->GetCursorPosition()); | 1653 EXPECT_EQ(500U, textfield_->GetCursorPosition()); |
| 1654 #endif | 1654 #endif |
| 1655 #endif // !defined(OS_WIN) | 1655 #endif // !defined(OS_WIN) |
| 1656 | 1656 |
| 1657 // Reset locale. | 1657 // Reset locale. |
| 1658 base::i18n::SetICUDefaultLocale(locale); | 1658 base::i18n::SetICUDefaultLocale(locale); |
| 1659 } | 1659 } |
| 1660 | 1660 |
| 1661 } // namespace views | 1661 } // namespace views |
| OLD | NEW |