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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
18 #include "ui/base/clipboard/clipboard.h" | 18 #include "ui/base/clipboard/clipboard.h" |
19 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 19 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
20 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
21 | 21 |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 #include "ui/base/clipboard/clipboard_util_win.h" | 23 #include "ui/base/clipboard/clipboard_util_win.h" |
24 #endif | 24 #endif |
25 | 25 |
26 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
27 #include "base/android/jni_android.h" | 27 #include "base/android/jni_android.h" |
28 #endif | 28 #endif |
29 | 29 |
30 #if defined(OS_WIN) || defined(USE_AURA) | |
31 #include "base/message_loop.h" | |
32 #endif | |
33 | |
34 namespace ui { | 30 namespace ui { |
35 | 31 |
36 class ClipboardTest : public PlatformTest { | 32 class ClipboardTest : public PlatformTest { |
37 protected: | 33 protected: |
38 Clipboard& clipboard() { return clipboard_; } | 34 Clipboard& clipboard() { return clipboard_; } |
39 | 35 |
40 private: | 36 private: |
41 base::MessageLoopForUI message_loop_; | 37 base::MessageLoopForUI message_loop_; |
42 Clipboard clipboard_; | 38 Clipboard clipboard_; |
43 }; | 39 }; |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 EXPECT_TRUE(clipboard().IsFormatAvailable( | 684 EXPECT_TRUE(clipboard().IsFormatAvailable( |
689 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD)); | 685 Clipboard::GetPlainTextWFormatType(), Clipboard::BUFFER_STANDARD)); |
690 | 686 |
691 // Make sure the text is what we inserted while simulating the other app | 687 // Make sure the text is what we inserted while simulating the other app |
692 std::string contents; | 688 std::string contents; |
693 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents); | 689 clipboard().ReadAsciiText(Clipboard::BUFFER_STANDARD, &contents); |
694 EXPECT_EQ(contents, new_value); | 690 EXPECT_EQ(contents, new_value); |
695 } | 691 } |
696 #endif | 692 #endif |
697 } // namespace ui | 693 } // namespace ui |
OLD | NEW |