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

Side by Side Diff: chrome/utility/importer/firefox_importer_unittest.cc

Issue 2321573002: //chrome misc: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Fix Win compilation Created 4 years, 3 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 (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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/files/scoped_temp_dir.h" 6 #include "base/files/scoped_temp_dir.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/chrome_paths.h" 10 #include "chrome/common/chrome_paths.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 // The following test verifies proper detection of authentication scheme in 57 // The following test verifies proper detection of authentication scheme in
58 // firefox's signons db. We insert two entries into moz_logins table. The first 58 // firefox's signons db. We insert two entries into moz_logins table. The first
59 // has httpRealm column filled with non-empty string, therefore resulting 59 // has httpRealm column filled with non-empty string, therefore resulting
60 // PasswordForm should have SCHEME_BASIC in scheme. The second entry has NULL 60 // PasswordForm should have SCHEME_BASIC in scheme. The second entry has NULL
61 // httpRealm, so it should produce a SCHEME_HTML PasswordForm. 61 // httpRealm, so it should produce a SCHEME_HTML PasswordForm.
62 TEST(FirefoxImporterTest, MAYBE_NSS(FirefoxNSSDecryptorDeduceAuthScheme)) { 62 TEST(FirefoxImporterTest, MAYBE_NSS(FirefoxNSSDecryptorDeduceAuthScheme)) {
63 base::ScopedTempDir temp_dir; 63 base::ScopedTempDir temp_dir;
64 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 64 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
65 base::FilePath signons_path = temp_dir.path().AppendASCII("signons.sqlite"); 65 base::FilePath signons_path =
66 temp_dir.GetPath().AppendASCII("signons.sqlite");
66 sql::Connection db_conn; 67 sql::Connection db_conn;
67 68
68 ASSERT_TRUE(db_conn.Open(signons_path)); 69 ASSERT_TRUE(db_conn.Open(signons_path));
69 70
70 ASSERT_TRUE(db_conn.Execute( 71 ASSERT_TRUE(db_conn.Execute(
71 "CREATE TABLE moz_logins (id INTEGER PRIMARY KEY, hostname TEXT NOT " 72 "CREATE TABLE moz_logins (id INTEGER PRIMARY KEY, hostname TEXT NOT "
72 "NULL, httpRealm TEXT, formSubmitURL TEXT, usernameField TEXT NOT NULL," 73 "NULL, httpRealm TEXT, formSubmitURL TEXT, usernameField TEXT NOT NULL,"
73 "passwordField TEXT NOT NULL, encryptedUsername TEXT NOT NULL," 74 "passwordField TEXT NOT NULL, encryptedUsername TEXT NOT NULL,"
74 "encryptedPassword TEXT NOT NULL, guid TEXT, encType INTEGER," 75 "encryptedPassword TEXT NOT NULL, guid TEXT, encType INTEGER,"
75 "timeCreated INTEGER, timeLastUsed INTEGER, timePasswordChanged " 76 "timeCreated INTEGER, timeLastUsed INTEGER, timePasswordChanged "
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ASSERT_TRUE(decryptor_proxy.Setup(nss_path)); 108 ASSERT_TRUE(decryptor_proxy.Setup(nss_path));
108 109
109 ASSERT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path)); 110 ASSERT_TRUE(decryptor_proxy.DecryptorInit(nss_path, db_path));
110 std::vector<autofill::PasswordForm> forms = 111 std::vector<autofill::PasswordForm> forms =
111 decryptor_proxy.ParseSignons(signons_path); 112 decryptor_proxy.ParseSignons(signons_path);
112 113
113 ASSERT_EQ(2u, forms.size()); 114 ASSERT_EQ(2u, forms.size());
114 EXPECT_EQ(autofill::PasswordForm::SCHEME_BASIC, forms[0].scheme); 115 EXPECT_EQ(autofill::PasswordForm::SCHEME_BASIC, forms[0].scheme);
115 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, forms[1].scheme); 116 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, forms[1].scheme);
116 } 117 }
OLDNEW
« no previous file with comments | « chrome/utility/importer/edge_database_reader_unittest_win.cc ('k') | chrome/utility/importer/safari_importer_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698