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

Side by Side Diff: chrome/browser/password_manager/login_database_unittest.cc

Issue 18684002: Fixing destruction order in login database unit tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 std::vector<string16> DeserializeVector(const Pickle& pickle) const { 35 std::vector<string16> DeserializeVector(const Pickle& pickle) const {
36 return db_.DeserializeVector(pickle); 36 return db_.DeserializeVector(pickle);
37 } 37 }
38 38
39 void SetPublicSuffixMatching(bool enabled) { 39 void SetPublicSuffixMatching(bool enabled) {
40 db_.public_suffix_domain_matching_ = enabled; 40 db_.public_suffix_domain_matching_ = enabled;
41 } 41 }
42 42
43 base::ScopedTempDir temp_dir_;
44 base::FilePath file_;
43 LoginDatabase db_; 45 LoginDatabase db_;
44 base::FilePath file_;
45 base::ScopedTempDir temp_dir_;
46 }; 46 };
47 47
48 TEST_F(LoginDatabaseTest, Logins) { 48 TEST_F(LoginDatabaseTest, Logins) {
49 std::vector<PasswordForm*> result; 49 std::vector<PasswordForm*> result;
50 50
51 // Verify the database is empty. 51 // Verify the database is empty.
52 EXPECT_TRUE(db_.GetAutofillableLogins(&result)); 52 EXPECT_TRUE(db_.GetAutofillableLogins(&result));
53 EXPECT_EQ(0U, result.size()); 53 EXPECT_EQ(0U, result.size());
54 54
55 // Example password form. 55 // Example password form.
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 560
561 // Normal data. 561 // Normal data.
562 vec.push_back(ASCIIToUTF16("first")); 562 vec.push_back(ASCIIToUTF16("first"));
563 vec.push_back(ASCIIToUTF16("second")); 563 vec.push_back(ASCIIToUTF16("second"));
564 vec.push_back(ASCIIToUTF16("third")); 564 vec.push_back(ASCIIToUTF16("third"));
565 565
566 temp = SerializeVector(vec); 566 temp = SerializeVector(vec);
567 output = DeserializeVector(temp); 567 output = DeserializeVector(temp);
568 EXPECT_THAT(output, Eq(vec)); 568 EXPECT_THAT(output, Eq(vec));
569 } 569 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698