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

Side by Side Diff: services/authentication/accounts_db_manager_unittest.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, 7 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "accounts_db_manager.h" 5 #include "accounts_db_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_tokenizer.h" 8 #include "base/strings/string_tokenizer.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/application_test_base.h" 10 #include "mojo/public/cpp/application/application_test_base.h"
11 #include "mojo/public/cpp/application/connect.h"
11 #include "mojo/services/files/interfaces/types.mojom.h" 12 #include "mojo/services/files/interfaces/types.mojom.h"
12 #include "services/authentication/credentials_impl_db.mojom.h" 13 #include "services/authentication/credentials_impl_db.mojom.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace authentication { 16 namespace authentication {
16 namespace { 17 namespace {
17 18
18 class AccountsDBTest : public mojo::test::ApplicationTestBase { 19 class AccountsDBTest : public mojo::test::ApplicationTestBase {
19 public: 20 public:
20 AccountsDBTest(){}; 21 AccountsDBTest(){};
21 ~AccountsDBTest() override{}; 22 ~AccountsDBTest() override{};
22 23
23 protected: 24 protected:
24 void SetUp() override { 25 void SetUp() override {
25 mojo::test::ApplicationTestBase::SetUp(); 26 mojo::test::ApplicationTestBase::SetUp();
26 mojo::files::FilesPtr files; 27 mojo::files::FilesPtr files;
27 application_impl()->ConnectToServiceDeprecated("mojo:files", &files); 28 mojo::ConnectToService(application_impl()->shell(), "mojo:files",
29 GetProxy(&files));
28 30
29 mojo::files::Error error = mojo::files::Error::INTERNAL; 31 mojo::files::Error error = mojo::files::Error::INTERNAL;
30 mojo::files::DirectoryPtr directory; 32 mojo::files::DirectoryPtr directory;
31 files->OpenFileSystem(nullptr, GetProxy(&directory), 33 files->OpenFileSystem(nullptr, GetProxy(&directory),
32 [&error](mojo::files::Error e) { error = e; }); 34 [&error](mojo::files::Error e) { error = e; });
33 CHECK(files.WaitForIncomingResponse()); 35 CHECK(files.WaitForIncomingResponse());
34 CHECK_EQ(mojo::files::Error::OK, error); 36 CHECK_EQ(mojo::files::Error::OK, error);
35 37
36 accounts_db_manager_ = new AccountsDbManager(directory.Pass()); 38 accounts_db_manager_ = new AccountsDbManager(directory.Pass());
37 } 39 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 153 }
152 154
153 TEST_F(AccountsDBTest, CanGetAuthorizedUserForInvalidApp) { 155 TEST_F(AccountsDBTest, CanGetAuthorizedUserForInvalidApp) {
154 accountsDBPtr()->UpdateAuthorization("url1", "user1"); 156 accountsDBPtr()->UpdateAuthorization("url1", "user1");
155 ASSERT_TRUE( 157 ASSERT_TRUE(
156 accountsDBPtr()->GetAuthorizedUserForApp("invalid_app_url").is_null()); 158 accountsDBPtr()->GetAuthorizedUserForApp("invalid_app_url").is_null());
157 } 159 }
158 160
159 } // namespace 161 } // namespace
160 } // namespace authentication 162 } // namespace authentication
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698