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

Side by Side Diff: remoting/host/linux/certificate_watcher_unittest.cc

Issue 1917053003: unique_ptr_migration: clean up references to scoped_ptr as of r389721 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « remoting/host/linux/certificate_watcher.h ('k') | remoting/host/remoting_me2me_host.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 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 "remoting/host/linux/certificate_watcher.h" 5 #include "remoting/host/linux/certificate_watcher.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "base/bind.h" 11 #include "base/bind.h"
11 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
12 #include "base/files/scoped_temp_dir.h" 13 #include "base/files/scoped_temp_dir.h"
13 #include "base/run_loop.h" 14 #include "base/run_loop.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 16
16 namespace remoting { 17 namespace remoting {
17 18
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 std::string testWriteString = std::to_string(rand()); 84 std::string testWriteString = std::to_string(rand());
84 85
85 base::WriteFile(watch_path_, testWriteString.c_str(), 86 base::WriteFile(watch_path_, testWriteString.c_str(),
86 testWriteString.length()); 87 testWriteString.length());
87 } 88 }
88 89
89 base::MessageLoopForIO message_loop_; 90 base::MessageLoopForIO message_loop_;
90 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
91 base::ScopedTempDir temp_dir_; 92 base::ScopedTempDir temp_dir_;
92 base::FilePath watch_path_; 93 base::FilePath watch_path_;
93 scoped_ptr<CertificateWatcher> watcher_; 94 std::unique_ptr<CertificateWatcher> watcher_;
94 int restart_count_ = 0; 95 int restart_count_ = 0;
95 base::TimeDelta loop_wait_ = 96 base::TimeDelta loop_wait_ =
96 base::TimeDelta::FromMilliseconds(kMessageLoopWaitMsecs); 97 base::TimeDelta::FromMilliseconds(kMessageLoopWaitMsecs);
97 base::Closure quit_loop_closure_; 98 base::Closure quit_loop_closure_;
98 99
99 private: 100 private:
100 const base::FilePath& CreateAndGetUniqueTempDir() { 101 const base::FilePath& CreateAndGetUniqueTempDir() {
101 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); 102 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir());
102 return temp_dir_.path(); 103 return temp_dir_.path();
103 } 104 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 EXPECT_EQ(0, restart_count_); 138 EXPECT_EQ(0, restart_count_);
138 Disconnect(); 139 Disconnect();
139 RunAndWait(); 140 RunAndWait();
140 EXPECT_EQ(0, restart_count_); 141 EXPECT_EQ(0, restart_count_);
141 TouchFile(); 142 TouchFile();
142 RunLoop(); 143 RunLoop();
143 EXPECT_EQ(1, restart_count_); 144 EXPECT_EQ(1, restart_count_);
144 } 145 }
145 146
146 } // namespace remoting 147 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/linux/certificate_watcher.h ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698