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

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

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/services/clipboard/interfaces/clipboard.mojom.h" 10 #include "mojo/services/clipboard/interfaces/clipboard.mojom.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 namespace clipboard { 48 namespace clipboard {
49 49
50 class ClipboardAppTest : public mojo::test::ApplicationTestBase { 50 class ClipboardAppTest : public mojo::test::ApplicationTestBase {
51 public: 51 public:
52 ClipboardAppTest() : ApplicationTestBase() {} 52 ClipboardAppTest() : ApplicationTestBase() {}
53 ~ClipboardAppTest() override {} 53 ~ClipboardAppTest() override {}
54 54
55 void SetUp() override { 55 void SetUp() override {
56 mojo::test::ApplicationTestBase::SetUp(); 56 mojo::test::ApplicationTestBase::SetUp();
57 application_impl()->ConnectToService("mojo:clipboard", &clipboard_); 57 application_impl()->ConnectToServiceDeprecated("mojo:clipboard",
58 &clipboard_);
58 } 59 }
59 60
60 uint64_t GetSequenceNumber() { 61 uint64_t GetSequenceNumber() {
61 base::RunLoop run_loop; 62 base::RunLoop run_loop;
62 uint64_t sequence_num = 999999; 63 uint64_t sequence_num = 999999;
63 clipboard_->GetSequenceNumber( 64 clipboard_->GetSequenceNumber(
64 Clipboard::Type::COPY_PASTE, 65 Clipboard::Type::COPY_PASTE,
65 base::Bind(&CopyUint64AndEndRunloop, &sequence_num, &run_loop)); 66 base::Bind(&CopyUint64AndEndRunloop, &sequence_num, &run_loop));
66 run_loop.Run(); 67 run_loop.Run();
67 return sequence_num; 68 return sequence_num;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 EXPECT_EQ(kPlainTextData, data); 148 EXPECT_EQ(kPlainTextData, data);
148 149
149 Map<String, Array<uint8_t>> mime_data; 150 Map<String, Array<uint8_t>> mime_data;
150 clipboard_->WriteClipboardData(Clipboard::Type::COPY_PASTE, mime_data.Pass()); 151 clipboard_->WriteClipboardData(Clipboard::Type::COPY_PASTE, mime_data.Pass());
151 152
152 EXPECT_EQ(2ul, GetSequenceNumber()); 153 EXPECT_EQ(2ul, GetSequenceNumber());
153 EXPECT_FALSE(GetDataOfType(Clipboard::MIME_TYPE_TEXT, &data)); 154 EXPECT_FALSE(GetDataOfType(Clipboard::MIME_TYPE_TEXT, &data));
154 } 155 }
155 156
156 } // namespace clipboard 157 } // 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