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

Side by Side Diff: remoting/host/pairing_registry_delegate_linux_unittest.cc

Issue 660803004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pairing_registry_delegate_linux.h" 5 #include "remoting/host/pairing_registry_delegate_linux.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace remoting { 12 namespace remoting {
13 13
14 using protocol::PairingRegistry; 14 using protocol::PairingRegistry;
15 15
16 class PairingRegistryDelegateLinuxTest : public testing::Test { 16 class PairingRegistryDelegateLinuxTest : public testing::Test {
17 public: 17 public:
18 virtual void SetUp() override { 18 void SetUp() override {
19 // Create a temporary directory in order to get a unique name and use a 19 // Create a temporary directory in order to get a unique name and use a
20 // subdirectory to ensure that PairingRegistryDelegateLinux::Save() creates 20 // subdirectory to ensure that PairingRegistryDelegateLinux::Save() creates
21 // the parent directory if it doesn't exist. 21 // the parent directory if it doesn't exist.
22 base::CreateNewTempDirectory("chromoting-test", &temp_dir_); 22 base::CreateNewTempDirectory("chromoting-test", &temp_dir_);
23 temp_registry_ = temp_dir_.Append("paired-clients"); 23 temp_registry_ = temp_dir_.Append("paired-clients");
24 } 24 }
25 25
26 virtual void TearDown() override { 26 void TearDown() override { base::DeleteFile(temp_dir_, true); }
27 base::DeleteFile(temp_dir_, true);
28 }
29 27
30 protected: 28 protected:
31 base::FilePath temp_dir_; 29 base::FilePath temp_dir_;
32 base::FilePath temp_registry_; 30 base::FilePath temp_registry_;
33 }; 31 };
34 32
35 TEST_F(PairingRegistryDelegateLinuxTest, SaveAndLoad) { 33 TEST_F(PairingRegistryDelegateLinuxTest, SaveAndLoad) {
36 scoped_ptr<PairingRegistryDelegateLinux> delegate( 34 scoped_ptr<PairingRegistryDelegateLinux> delegate(
37 new PairingRegistryDelegateLinux()); 35 new PairingRegistryDelegateLinux());
38 delegate->SetRegistryPathForTesting(temp_registry_); 36 delegate->SetRegistryPathForTesting(temp_registry_);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 new PairingRegistryDelegateLinux()); 78 new PairingRegistryDelegateLinux());
81 save_delegate->SetRegistryPathForTesting(temp_registry_); 79 save_delegate->SetRegistryPathForTesting(temp_registry_);
82 load_delegate->SetRegistryPathForTesting(temp_registry_); 80 load_delegate->SetRegistryPathForTesting(temp_registry_);
83 81
84 PairingRegistry::Pairing pairing(base::Time::Now(), "xxx", "xxx", "xxx"); 82 PairingRegistry::Pairing pairing(base::Time::Now(), "xxx", "xxx", "xxx");
85 EXPECT_TRUE(save_delegate->Save(pairing)); 83 EXPECT_TRUE(save_delegate->Save(pairing));
86 EXPECT_EQ(load_delegate->Load(pairing.client_id()), pairing); 84 EXPECT_EQ(load_delegate->Load(pairing.client_id()), pairing);
87 } 85 }
88 86
89 } // namespace remoting 87 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/pairing_registry_delegate_linux.h ('k') | remoting/host/policy_hack/policy_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698