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

Side by Side Diff: remoting/test/app_remoting_test_driver_environment_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/test/app_remoting_test_driver_environment.h" 5 #include "remoting/test/app_remoting_test_driver_environment.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 void Initialize(); 48 void Initialize();
49 void Initialize( 49 void Initialize(
50 const AppRemotingTestDriverEnvironment::EnvironmentOptions& options); 50 const AppRemotingTestDriverEnvironment::EnvironmentOptions& options);
51 51
52 FakeAccessTokenFetcher* fake_access_token_fetcher_; 52 FakeAccessTokenFetcher* fake_access_token_fetcher_;
53 FakeAppRemotingReportIssueRequest fake_report_issue_request_; 53 FakeAppRemotingReportIssueRequest fake_report_issue_request_;
54 FakeRefreshTokenStore fake_token_store_; 54 FakeRefreshTokenStore fake_token_store_;
55 FakeRemoteHostInfoFetcher fake_remote_host_info_fetcher_; 55 FakeRemoteHostInfoFetcher fake_remote_host_info_fetcher_;
56 MockAccessTokenFetcher mock_access_token_fetcher_; 56 MockAccessTokenFetcher mock_access_token_fetcher_;
57 57
58 scoped_ptr<AppRemotingTestDriverEnvironment> environment_object_; 58 std::unique_ptr<AppRemotingTestDriverEnvironment> environment_object_;
59 59
60 private: 60 private:
61 DISALLOW_COPY_AND_ASSIGN(AppRemotingTestDriverEnvironmentTest); 61 DISALLOW_COPY_AND_ASSIGN(AppRemotingTestDriverEnvironmentTest);
62 }; 62 };
63 63
64 AppRemotingTestDriverEnvironmentTest::AppRemotingTestDriverEnvironmentTest() 64 AppRemotingTestDriverEnvironmentTest::AppRemotingTestDriverEnvironmentTest()
65 : fake_access_token_fetcher_(nullptr) { 65 : fake_access_token_fetcher_(nullptr) {
66 } 66 }
67 67
68 AppRemotingTestDriverEnvironmentTest::~AppRemotingTestDriverEnvironmentTest() { 68 AppRemotingTestDriverEnvironmentTest::~AppRemotingTestDriverEnvironmentTest() {
69 } 69 }
70 70
71 void AppRemotingTestDriverEnvironmentTest::Initialize() { 71 void AppRemotingTestDriverEnvironmentTest::Initialize() {
72 AppRemotingTestDriverEnvironment::EnvironmentOptions options; 72 AppRemotingTestDriverEnvironment::EnvironmentOptions options;
73 options.user_name = kUserNameValue; 73 options.user_name = kUserNameValue;
74 options.service_environment = kDeveloperEnvironment; 74 options.service_environment = kDeveloperEnvironment;
75 75
76 Initialize(options); 76 Initialize(options);
77 } 77 }
78 78
79 void AppRemotingTestDriverEnvironmentTest::Initialize( 79 void AppRemotingTestDriverEnvironmentTest::Initialize(
80 const AppRemotingTestDriverEnvironment::EnvironmentOptions& options) { 80 const AppRemotingTestDriverEnvironment::EnvironmentOptions& options) {
81 environment_object_.reset(new AppRemotingTestDriverEnvironment(options)); 81 environment_object_.reset(new AppRemotingTestDriverEnvironment(options));
82 82
83 scoped_ptr<FakeAccessTokenFetcher> fake_access_token_fetcher( 83 std::unique_ptr<FakeAccessTokenFetcher> fake_access_token_fetcher(
84 new FakeAccessTokenFetcher()); 84 new FakeAccessTokenFetcher());
85 fake_access_token_fetcher_ = fake_access_token_fetcher.get(); 85 fake_access_token_fetcher_ = fake_access_token_fetcher.get();
86 mock_access_token_fetcher_.SetAccessTokenFetcher( 86 mock_access_token_fetcher_.SetAccessTokenFetcher(
87 std::move(fake_access_token_fetcher)); 87 std::move(fake_access_token_fetcher));
88 88
89 environment_object_->SetAccessTokenFetcherForTest( 89 environment_object_->SetAccessTokenFetcherForTest(
90 &mock_access_token_fetcher_); 90 &mock_access_token_fetcher_);
91 environment_object_->SetAppRemotingReportIssueRequestForTest( 91 environment_object_->SetAppRemotingReportIssueRequestForTest(
92 &fake_report_issue_request_); 92 &fake_report_issue_request_);
93 environment_object_->SetRefreshTokenStoreForTest(&fake_token_store_); 93 environment_object_->SetRefreshTokenStoreForTest(&fake_token_store_);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 std::sort(expected_host_list.begin(), expected_host_list.end()); 465 std::sort(expected_host_list.begin(), expected_host_list.end());
466 466
467 EXPECT_EQ(actual_host_list.size(), expected_host_list.size()); 467 EXPECT_EQ(actual_host_list.size(), expected_host_list.size());
468 for (size_t i = 0; i < actual_host_list.size(); ++i) { 468 for (size_t i = 0; i < actual_host_list.size(); ++i) {
469 EXPECT_EQ(actual_host_list[i], expected_host_list[i]); 469 EXPECT_EQ(actual_host_list[i], expected_host_list[i]);
470 } 470 }
471 } 471 }
472 472
473 } // namespace test 473 } // namespace test
474 } // namespace remoting 474 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/app_remoting_test_driver_environment.cc ('k') | remoting/test/chromoting_test_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698