| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace | 252 } // namespace |
| 253 | 253 |
| 254 | 254 |
| 255 // PasswordManagerBrowserTest ------------------------------------------------- | 255 // PasswordManagerBrowserTest ------------------------------------------------- |
| 256 | 256 |
| 257 class PasswordManagerBrowserTest : public InProcessBrowserTest { | 257 class PasswordManagerBrowserTest : public InProcessBrowserTest { |
| 258 public: | 258 public: |
| 259 PasswordManagerBrowserTest() {} | 259 PasswordManagerBrowserTest() {} |
| 260 virtual ~PasswordManagerBrowserTest() {} | 260 ~PasswordManagerBrowserTest() override {} |
| 261 | 261 |
| 262 // InProcessBrowserTest: | 262 // InProcessBrowserTest: |
| 263 void SetUpOnMainThread() override { | 263 void SetUpOnMainThread() override { |
| 264 // Use TestPasswordStore to remove a possible race. Normally the | 264 // Use TestPasswordStore to remove a possible race. Normally the |
| 265 // PasswordStore does its database manipulation on the DB thread, which | 265 // PasswordStore does its database manipulation on the DB thread, which |
| 266 // creates a possible race during navigation. Specifically the | 266 // creates a possible race during navigation. Specifically the |
| 267 // PasswordManager will ignore any forms in a page if the load from the | 267 // PasswordManager will ignore any forms in a page if the load from the |
| 268 // PasswordStore has not completed. | 268 // PasswordStore has not completed. |
| 269 PasswordStoreFactory::GetInstance()->SetTestingFactory( | 269 PasswordStoreFactory::GetInstance()->SetTestingFactory( |
| 270 browser()->profile(), TestPasswordStoreService::Build); | 270 browser()->profile(), TestPasswordStoreService::Build); |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 NavigateToFile("/password/form_with_only_password_field.html"); | 1290 NavigateToFile("/password/form_with_only_password_field.html"); |
| 1291 | 1291 |
| 1292 // Let the user interact with the page, so that DOM gets modification events, | 1292 // Let the user interact with the page, so that DOM gets modification events, |
| 1293 // needed for autofilling fields. | 1293 // needed for autofilling fields. |
| 1294 content::SimulateMouseClickAt( | 1294 content::SimulateMouseClickAt( |
| 1295 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 1295 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); |
| 1296 | 1296 |
| 1297 // Wait until that interaction causes the password value to be revealed. | 1297 // Wait until that interaction causes the password value to be revealed. |
| 1298 WaitForElementValue("password", "mypassword"); | 1298 WaitForElementValue("password", "mypassword"); |
| 1299 } | 1299 } |
| OLD | NEW |