| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/textfield/textfield_model.h" |
| 6 |
| 5 #include <stddef.h> | 7 #include <stddef.h> |
| 6 | 8 |
| 9 #include <memory> |
| 7 #include <vector> | 10 #include <vector> |
| 8 | 11 |
| 9 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
| 10 #include "base/macros.h" | 13 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 15 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "ui/base/clipboard/clipboard.h" | 19 #include "ui/base/clipboard/clipboard.h" |
| 18 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 20 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 19 #include "ui/gfx/range/range.h" | 21 #include "ui/gfx/range/range.h" |
| 20 #include "ui/gfx/render_text.h" | 22 #include "ui/gfx/render_text.h" |
| 21 #include "ui/views/controls/textfield/textfield.h" | 23 #include "ui/views/controls/textfield/textfield.h" |
| 22 #include "ui/views/controls/textfield/textfield_model.h" | |
| 23 #include "ui/views/test/test_views_delegate.h" | 24 #include "ui/views/test/test_views_delegate.h" |
| 24 #include "ui/views/test/views_test_base.h" | 25 #include "ui/views/test/views_test_base.h" |
| 25 | 26 |
| 26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 27 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
| 28 #endif | 29 #endif |
| 29 | 30 |
| 30 #define EXPECT_STR_EQ(ascii, utf16) EXPECT_EQ(base::ASCIIToUTF16(ascii), utf16) | 31 #define EXPECT_STR_EQ(ascii, utf16) EXPECT_EQ(base::ASCIIToUTF16(ascii), utf16) |
| 31 | 32 |
| 32 namespace { | 33 namespace { |
| (...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 // Test 7 | 1583 // Test 7 |
| 1583 // Clipboard text with lots of spaces between words should have all spaces | 1584 // Clipboard text with lots of spaces between words should have all spaces |
| 1584 // replaced with a single space. | 1585 // replaced with a single space. |
| 1585 ui::ScopedClipboardWriter(ui::CLIPBOARD_TYPE_COPY_PASTE) | 1586 ui::ScopedClipboardWriter(ui::CLIPBOARD_TYPE_COPY_PASTE) |
| 1586 .WriteText(base::ASCIIToUTF16("FOO BAR")); | 1587 .WriteText(base::ASCIIToUTF16("FOO BAR")); |
| 1587 EXPECT_TRUE(model.Paste()); | 1588 EXPECT_TRUE(model.Paste()); |
| 1588 EXPECT_STR_EQ("FOO BAR", model.text()); | 1589 EXPECT_STR_EQ("FOO BAR", model.text()); |
| 1589 } | 1590 } |
| 1590 | 1591 |
| 1591 } // namespace views | 1592 } // namespace views |
| OLD | NEW |