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

Side by Side Diff: components/os_crypt/os_crypt_unittest.cc

Issue 684513002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 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 "components/os_crypt/os_crypt.h" 5 #include "components/os_crypt/os_crypt.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace { 14 namespace {
15 15
16 class OSCryptTest : public testing::Test { 16 class OSCryptTest : public testing::Test {
17 public: 17 public:
18 OSCryptTest() {} 18 OSCryptTest() {}
19 19
20 virtual void SetUp() override { 20 void SetUp() override {
21 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
22 OSCrypt::UseMockKeychain(true); 22 OSCrypt::UseMockKeychain(true);
23 #endif 23 #endif
24 } 24 }
25 25
26 private: 26 private:
27 DISALLOW_COPY_AND_ASSIGN(OSCryptTest); 27 DISALLOW_COPY_AND_ASSIGN(OSCryptTest);
28 }; 28 };
29 29
30 TEST_F(OSCryptTest, String16EncryptionDecryption) { 30 TEST_F(OSCryptTest, String16EncryptionDecryption) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ASSERT_TRUE(OSCrypt::EncryptString(plaintext, &ciphertext)); 135 ASSERT_TRUE(OSCrypt::EncryptString(plaintext, &ciphertext));
136 EXPECT_NE(plaintext, ciphertext); 136 EXPECT_NE(plaintext, ciphertext);
137 ASSERT_LT(4UL, ciphertext.size()); 137 ASSERT_LT(4UL, ciphertext.size());
138 ciphertext[3] = ciphertext[3] + 1; 138 ciphertext[3] = ciphertext[3] + 1;
139 EXPECT_FALSE(OSCrypt::DecryptString(ciphertext, &result)); 139 EXPECT_FALSE(OSCrypt::DecryptString(ciphertext, &result));
140 EXPECT_NE(plaintext, result); 140 EXPECT_NE(plaintext, result);
141 EXPECT_TRUE(result.empty()); 141 EXPECT_TRUE(result.empty());
142 } 142 }
143 143
144 } // namespace 144 } // namespace
OLDNEW
« no previous file with comments | « components/omnibox/keyword_provider_unittest.cc ('k') | components/ownership/mock_owner_key_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698