| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/mus/clipboard_mus.h" |
| 6 |
| 7 #include "base/message_loop/message_loop.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "ui/events/platform/platform_event_source.h" |
| 10 #include "ui/views/mus/window_manager_connection.h" |
| 11 #include "ui/views/test/scoped_views_test_helper.h" |
| 12 |
| 13 namespace ui { |
| 14 |
| 15 struct PlatformClipboardTraits { |
| 16 static std::unique_ptr<PlatformEventSource> GetEventSource() { |
| 17 return std::unique_ptr<PlatformEventSource>(); |
| 18 } |
| 19 |
| 20 static Clipboard* Create() { |
| 21 EXPECT_FALSE(test_helper.get()); |
| 22 |
| 23 // We need to set up enough of views so that it reaches out to mus for a |
| 24 // window manager connection. |
| 25 test_helper.reset(new views::ScopedViewsTestHelper); |
| 26 |
| 27 // If we don't have a window manager connection, we will get the default |
| 28 // platform clipboard instead. |
| 29 EXPECT_TRUE(views::WindowManagerConnection::Exists()); |
| 30 |
| 31 return Clipboard::GetForCurrentThread(); |
| 32 } |
| 33 |
| 34 static void Destroy(Clipboard* clipboard) { |
| 35 ASSERT_EQ(Clipboard::GetForCurrentThread(), clipboard); |
| 36 Clipboard::DestroyClipboardForCurrentThread(); |
| 37 |
| 38 test_helper.reset(); |
| 39 } |
| 40 |
| 41 static std::unique_ptr<views::ScopedViewsTestHelper> test_helper; |
| 42 }; |
| 43 |
| 44 std::unique_ptr<views::ScopedViewsTestHelper> |
| 45 PlatformClipboardTraits::test_helper; |
| 46 |
| 47 typedef PlatformClipboardTraits TypesToTest; |
| 48 |
| 49 } // namespace ui |
| 50 |
| 51 #include "ui/base/clipboard/clipboard_test_template.h" |
| OLD | NEW |