OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/macros.h" |
7 #include "mojo/common/common_type_converters.h" | 8 #include "mojo/common/common_type_converters.h" |
8 #include "mojo/services/public/interfaces/clipboard/clipboard.mojom.h" | 9 #include "mojo/services/public/interfaces/clipboard/clipboard.mojom.h" |
9 #include "mojo/shell/shell_test_helper.h" | 10 #include "mojo/shell/shell_test_helper.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 void CopyUint64AndEndRunloop(uint64_t* output, | 15 void CopyUint64AndEndRunloop(uint64_t* output, |
15 base::RunLoop* run_loop, | 16 base::RunLoop* run_loop, |
16 uint64_t input) { | 17 uint64_t input) { |
(...skipping 24 matching lines...) Expand all Loading... |
41 } // namespace | 42 } // namespace |
42 | 43 |
43 namespace mojo { | 44 namespace mojo { |
44 namespace service { | 45 namespace service { |
45 | 46 |
46 class ClipboardStandaloneTest : public testing::Test { | 47 class ClipboardStandaloneTest : public testing::Test { |
47 public: | 48 public: |
48 ClipboardStandaloneTest() {} | 49 ClipboardStandaloneTest() {} |
49 virtual ~ClipboardStandaloneTest() {} | 50 virtual ~ClipboardStandaloneTest() {} |
50 | 51 |
51 virtual void SetUp() OVERRIDE { | 52 virtual void SetUp() override { |
52 test_helper_.Init(); | 53 test_helper_.Init(); |
53 | 54 |
54 test_helper_.application_manager()->ConnectToService( | 55 test_helper_.application_manager()->ConnectToService( |
55 GURL("mojo:mojo_clipboard"), &clipboard_); | 56 GURL("mojo:mojo_clipboard"), &clipboard_); |
56 } | 57 } |
57 | 58 |
58 uint64_t GetSequenceNumber() { | 59 uint64_t GetSequenceNumber() { |
59 base::RunLoop run_loop; | 60 base::RunLoop run_loop; |
60 uint64_t sequence_num = 999999; | 61 uint64_t sequence_num = 999999; |
61 clipboard_->GetSequenceNumber( | 62 clipboard_->GetSequenceNumber( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 Array<MimeTypePairPtr> mime_data(0); | 177 Array<MimeTypePairPtr> mime_data(0); |
177 clipboard_->WriteClipboardData(mojo::Clipboard::TYPE_COPY_PASTE, | 178 clipboard_->WriteClipboardData(mojo::Clipboard::TYPE_COPY_PASTE, |
178 mime_data.Pass()); | 179 mime_data.Pass()); |
179 | 180 |
180 EXPECT_EQ(2ul, GetSequenceNumber()); | 181 EXPECT_EQ(2ul, GetSequenceNumber()); |
181 EXPECT_FALSE(GetDataOfType(mojo::Clipboard::MIME_TYPE_TEXT, &data)); | 182 EXPECT_FALSE(GetDataOfType(mojo::Clipboard::MIME_TYPE_TEXT, &data)); |
182 } | 183 } |
183 | 184 |
184 } // namespace service | 185 } // namespace service |
185 } // namespace mojo | 186 } // namespace mojo |
OLD | NEW |