Chromium Code Reviews| 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/base/test/test_clipboard.h" | 5 #include "ui/base/test/test_clipboard.h" |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 #if defined(USE_AURA) | |
| 10 #include "ui/events/platform/platform_event_source.h" | |
| 11 #endif | |
| 12 | |
| 9 namespace ui { | 13 namespace ui { |
| 10 | 14 |
| 11 struct TestClipboardTraits { | 15 struct TestClipboardTraits { |
| 16 #if defined(USE_AURA) | |
| 17 static std::unique_ptr<PlatformEventSource> GetEventSource() { | |
| 18 return PlatformEventSource::CreateDefault(); | |
|
dcheng
2016/06/04 06:14:00
This can just return nullptr, I think.
| |
| 19 } | |
| 20 #endif | |
| 21 | |
| 12 static Clipboard* Create() { return TestClipboard::CreateForCurrentThread(); } | 22 static Clipboard* Create() { return TestClipboard::CreateForCurrentThread(); } |
| 13 | 23 |
| 24 static bool IsMusTest() { return false; } | |
| 25 | |
| 14 static void Destroy(Clipboard* clipboard) { | 26 static void Destroy(Clipboard* clipboard) { |
| 15 ASSERT_EQ(Clipboard::GetForCurrentThread(), clipboard); | 27 ASSERT_EQ(Clipboard::GetForCurrentThread(), clipboard); |
| 16 Clipboard::DestroyClipboardForCurrentThread(); | 28 Clipboard::DestroyClipboardForCurrentThread(); |
| 17 } | 29 } |
| 18 }; | 30 }; |
| 19 | 31 |
| 20 typedef TestClipboardTraits TypesToTest; | 32 typedef TestClipboardTraits TypesToTest; |
| 21 | 33 |
| 22 } // namespace ui | 34 } // namespace ui |
| 23 | 35 |
| 24 #include "ui/base/clipboard/clipboard_test_template.h" | 36 #include "ui/base/clipboard/clipboard_test_template.h" |
| OLD | NEW |