| 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 // Note: This header doesn't use REGISTER_TYPED_TEST_CASE_P like most | 5 // Note: This header doesn't use REGISTER_TYPED_TEST_CASE_P like most |
| 6 // type-parameterized gtests. There are lot of test cases in here that are only | 6 // type-parameterized gtests. There are lot of test cases in here that are only |
| 7 // enabled on certain platforms. However, preprocessor directives in macro | 7 // enabled on certain platforms. However, preprocessor directives in macro |
| 8 // arguments result in undefined behavior (and don't work on MSVC). Instead, | 8 // arguments result in undefined behavior (and don't work on MSVC). Instead, |
| 9 // 'parameterized' tests should typedef TypesToTest (which is used to | 9 // 'parameterized' tests should typedef TypesToTest (which is used to |
| 10 // instantiate the tests using the TYPED_TEST_CASE macro) and then #include this | 10 // instantiate the tests using the TYPED_TEST_CASE macro) and then #include this |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 using testing::Contains; | 50 using testing::Contains; |
| 51 | 51 |
| 52 namespace ui { | 52 namespace ui { |
| 53 | 53 |
| 54 template <typename ClipboardTraits> | 54 template <typename ClipboardTraits> |
| 55 class ClipboardTest : public PlatformTest { | 55 class ClipboardTest : public PlatformTest { |
| 56 public: | 56 public: |
| 57 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 58 ClipboardTest() | 58 ClipboardTest() |
| 59 : event_source_(PlatformEventSource::CreateDefault()), | 59 : event_source_(ClipboardTraits::GetEventSource()), |
| 60 clipboard_(ClipboardTraits::Create()) {} | 60 clipboard_(ClipboardTraits::Create()) {} |
| 61 #else | 61 #else |
| 62 ClipboardTest() : clipboard_(ClipboardTraits::Create()) {} | 62 ClipboardTest() : clipboard_(ClipboardTraits::Create()) {} |
| 63 #endif | 63 #endif |
| 64 | 64 |
| 65 ~ClipboardTest() override { ClipboardTraits::Destroy(clipboard_); } | 65 ~ClipboardTest() override { ClipboardTraits::Destroy(clipboard_); } |
| 66 | 66 |
| 67 protected: | 67 protected: |
| 68 Clipboard& clipboard() { return *clipboard_; } | 68 Clipboard& clipboard() { return *clipboard_; } |
| 69 | 69 |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 ScopedClipboardWriter scw(CLIPBOARD_TYPE_COPY_PASTE); | 670 ScopedClipboardWriter scw(CLIPBOARD_TYPE_COPY_PASTE); |
| 671 scw.WritePickledData(base::Pickle(), Clipboard::GetPlainTextFormatType()); | 671 scw.WritePickledData(base::Pickle(), Clipboard::GetPlainTextFormatType()); |
| 672 } | 672 } |
| 673 | 673 |
| 674 TYPED_TEST(ClipboardTest, WriteImageEmptyParams) { | 674 TYPED_TEST(ClipboardTest, WriteImageEmptyParams) { |
| 675 ScopedClipboardWriter scw(CLIPBOARD_TYPE_COPY_PASTE); | 675 ScopedClipboardWriter scw(CLIPBOARD_TYPE_COPY_PASTE); |
| 676 scw.WriteImage(SkBitmap()); | 676 scw.WriteImage(SkBitmap()); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace ui | 679 } // namespace ui |
| OLD | NEW |