OLD | NEW |
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 "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 GURL("https://accounts.google.com/ServiceLogin?continue=" | 291 GURL("https://accounts.google.com/ServiceLogin?continue=" |
292 "https://passwords.google.com:443/settings&rart=123")); | 292 "https://passwords.google.com:443/settings&rart=123")); |
293 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); | 293 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); |
294 | 294 |
295 // Encoded URL is considered the same. | 295 // Encoded URL is considered the same. |
296 NavigateAndCommit( | 296 NavigateAndCommit( |
297 GURL("https://accounts.google.com/ServiceLogin?continue=" | 297 GURL("https://accounts.google.com/ServiceLogin?continue=" |
298 "https://passwords.%67oogle.com/settings&rart=123")); | 298 "https://passwords.%67oogle.com/settings&rart=123")); |
299 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); | 299 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); |
300 | 300 |
| 301 // Make sure testing sites are disabled as well. |
| 302 NavigateAndCommit( |
| 303 GURL("https://accounts.google.com/Login?continue=" |
| 304 "https://passwords-testing.corp.google.com/settings&rart=456")); |
| 305 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); |
| 306 |
301 // Fully qualified domain name is considered a different hostname by GURL. | 307 // Fully qualified domain name is considered a different hostname by GURL. |
302 // Ideally this would not be the case, but this quirk can be avoided by | 308 // Ideally this would not be the case, but this quirk can be avoided by |
303 // verification on the server. This test is simply documentation of this | 309 // verification on the server. This test is simply documentation of this |
304 // behavior. | 310 // behavior. |
305 NavigateAndCommit( | 311 NavigateAndCommit( |
306 GURL("https://accounts.google.com/ServiceLogin?continue=" | 312 GURL("https://accounts.google.com/ServiceLogin?continue=" |
307 "https://passwords.google.com./settings&rart=123")); | 313 "https://passwords.google.com./settings&rart=123")); |
308 EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage()); | 314 EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage()); |
309 | 315 |
310 // Not a transactional reauth page. | 316 // Not a transactional reauth page. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 383 |
378 std::vector<GURL> federations; | 384 std::vector<GURL> federations; |
379 client->OnRequestCredential(kRequestId, false, federations); | 385 client->OnRequestCredential(kRequestId, false, federations); |
380 | 386 |
381 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; | 387 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; |
382 const IPC::Message* message = | 388 const IPC::Message* message = |
383 process()->sink().GetFirstMessageMatching(kMsgID); | 389 process()->sink().GetFirstMessageMatching(kMsgID); |
384 EXPECT_TRUE(message); | 390 EXPECT_TRUE(message); |
385 process()->sink().ClearMessages(); | 391 process()->sink().ClearMessages(); |
386 } | 392 } |
OLD | NEW |