| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. | 301 // Make sure testing sites are disabled as well. |
| 302 NavigateAndCommit( | 302 NavigateAndCommit( |
| 303 GURL("https://accounts.google.com/Login?continue=" | 303 GURL("https://accounts.google.com/Login?continue=" |
| 304 "https://passwords-testing.corp.google.com/settings&rart=456")); | 304 "https://passwords-ac-testing.corp.google.com/settings&rart=456")); |
| 305 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); | 305 EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); |
| 306 | 306 |
| 307 // Fully qualified domain name is considered a different hostname by GURL. | 307 // Fully qualified domain name is considered a different hostname by GURL. |
| 308 // 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 |
| 309 // verification on the server. This test is simply documentation of this | 309 // verification on the server. This test is simply documentation of this |
| 310 // behavior. | 310 // behavior. |
| 311 NavigateAndCommit( | 311 NavigateAndCommit( |
| 312 GURL("https://accounts.google.com/ServiceLogin?continue=" | 312 GURL("https://accounts.google.com/ServiceLogin?continue=" |
| 313 "https://passwords.google.com./settings&rart=123")); | 313 "https://passwords.google.com./settings&rart=123")); |
| 314 EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage()); | 314 EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage()); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 383 |
| 384 std::vector<GURL> federations; | 384 std::vector<GURL> federations; |
| 385 client->OnRequestCredential(kRequestId, false, federations); | 385 client->OnRequestCredential(kRequestId, false, federations); |
| 386 | 386 |
| 387 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; | 387 const uint32 kMsgID = CredentialManagerMsg_SendCredential::ID; |
| 388 const IPC::Message* message = | 388 const IPC::Message* message = |
| 389 process()->sink().GetFirstMessageMatching(kMsgID); | 389 process()->sink().GetFirstMessageMatching(kMsgID); |
| 390 EXPECT_TRUE(message); | 390 EXPECT_TRUE(message); |
| 391 process()->sink().ClearMessages(); | 391 process()->sink().ClearMessages(); |
| 392 } | 392 } |
| OLD | NEW |