Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: services/clipboard/clipboard_apptest.cc

Issue 1915403002: ApplicationImpl::ConnectToServiceDeprecated() -> mojo::ConnectToService() conversion, part 2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/authentication/main.cc ('k') | services/contacts/contacts_apptest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "mojo/converters/array_string/array_string_type_converters.h" 7 #include "mojo/converters/array_string/array_string_type_converters.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/public/cpp/application/application_test_base.h" 9 #include "mojo/public/cpp/application/application_test_base.h"
10 #include "mojo/public/cpp/application/connect.h"
10 #include "mojo/services/clipboard/interfaces/clipboard.mojom.h" 11 #include "mojo/services/clipboard/interfaces/clipboard.mojom.h"
11 12
12 using mojo::Array; 13 using mojo::Array;
13 using mojo::Clipboard; 14 using mojo::Clipboard;
14 using mojo::Map; 15 using mojo::Map;
15 using mojo::String; 16 using mojo::String;
16 17
17 namespace { 18 namespace {
18 19
19 void CopyUint64AndEndRunloop(uint64_t* output, 20 void CopyUint64AndEndRunloop(uint64_t* output,
(...skipping 27 matching lines...) Expand all
47 48
48 namespace clipboard { 49 namespace clipboard {
49 50
50 class ClipboardAppTest : public mojo::test::ApplicationTestBase { 51 class ClipboardAppTest : public mojo::test::ApplicationTestBase {
51 public: 52 public:
52 ClipboardAppTest() : ApplicationTestBase() {} 53 ClipboardAppTest() : ApplicationTestBase() {}
53 ~ClipboardAppTest() override {} 54 ~ClipboardAppTest() override {}
54 55
55 void SetUp() override { 56 void SetUp() override {
56 mojo::test::ApplicationTestBase::SetUp(); 57 mojo::test::ApplicationTestBase::SetUp();
57 application_impl()->ConnectToServiceDeprecated("mojo:clipboard", 58 mojo::ConnectToService(application_impl()->shell(), "mojo:clipboard",
58 &clipboard_); 59 GetProxy(&clipboard_));
59 } 60 }
60 61
61 uint64_t GetSequenceNumber() { 62 uint64_t GetSequenceNumber() {
62 base::RunLoop run_loop; 63 base::RunLoop run_loop;
63 uint64_t sequence_num = 999999; 64 uint64_t sequence_num = 999999;
64 clipboard_->GetSequenceNumber( 65 clipboard_->GetSequenceNumber(
65 Clipboard::Type::COPY_PASTE, 66 Clipboard::Type::COPY_PASTE,
66 base::Bind(&CopyUint64AndEndRunloop, &sequence_num, &run_loop)); 67 base::Bind(&CopyUint64AndEndRunloop, &sequence_num, &run_loop));
67 run_loop.Run(); 68 run_loop.Run();
68 return sequence_num; 69 return sequence_num;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 EXPECT_EQ(kPlainTextData, data); 149 EXPECT_EQ(kPlainTextData, data);
149 150
150 Map<String, Array<uint8_t>> mime_data; 151 Map<String, Array<uint8_t>> mime_data;
151 clipboard_->WriteClipboardData(Clipboard::Type::COPY_PASTE, mime_data.Pass()); 152 clipboard_->WriteClipboardData(Clipboard::Type::COPY_PASTE, mime_data.Pass());
152 153
153 EXPECT_EQ(2ul, GetSequenceNumber()); 154 EXPECT_EQ(2ul, GetSequenceNumber());
154 EXPECT_FALSE(GetDataOfType(Clipboard::MIME_TYPE_TEXT, &data)); 155 EXPECT_FALSE(GetDataOfType(Clipboard::MIME_TYPE_TEXT, &data));
155 } 156 }
156 157
157 } // namespace clipboard 158 } // namespace clipboard
OLDNEW
« no previous file with comments | « services/authentication/main.cc ('k') | services/contacts/contacts_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698