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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 run_loop.RunUntilIdle(); | 1359 run_loop.RunUntilIdle(); |
1360 EXPECT_FALSE(password_store->IsEmpty()); | 1360 EXPECT_FALSE(password_store->IsEmpty()); |
1361 } | 1361 } |
1362 | 1362 |
1363 // In some situations, multiple PasswordFormManager instances from | 1363 // In some situations, multiple PasswordFormManager instances from |
1364 // PasswordManager::pending_login_managers_ would match (via DoesManage) a form | 1364 // PasswordManager::pending_login_managers_ would match (via DoesManage) a form |
1365 // to be provisionally saved. One of them might be a complete match, the other | 1365 // to be provisionally saved. One of them might be a complete match, the other |
1366 // all-but-action match. Normally, the former should be preferred, but if the | 1366 // all-but-action match. Normally, the former should be preferred, but if the |
1367 // former has not finished matching, and the latter has, the latter should be | 1367 // former has not finished matching, and the latter has, the latter should be |
1368 // used (otherwise we'd give up even though we could have saved the password). | 1368 // used (otherwise we'd give up even though we could have saved the password). |
| 1369 // |
| 1370 // Disabled on Mac due to flakiness: http://crbug.com/477812 |
| 1371 #if defined(OS_MACOSX) |
| 1372 #define MAYBE_PreferPasswordFormManagerWhichFinishedMatching \ |
| 1373 DISABLED_PreferPasswordFormManagerWhichFinishedMatching |
| 1374 #else |
| 1375 #define MAYBE_PreferPasswordFormManagerWhichFinishedMatching \ |
| 1376 PreferPasswordFormManagerWhichFinishedMatching |
| 1377 #endif |
1369 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, | 1378 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, |
1370 PreferPasswordFormManagerWhichFinishedMatching) { | 1379 MAYBE_PreferPasswordFormManagerWhichFinishedMatching) { |
1371 NavigateToFile("/password/create_form_copy_on_submit.html"); | 1380 NavigateToFile("/password/create_form_copy_on_submit.html"); |
1372 | 1381 |
1373 NavigationObserver observer(WebContents()); | 1382 NavigationObserver observer(WebContents()); |
1374 scoped_ptr<PromptObserver> prompt_observer( | 1383 scoped_ptr<PromptObserver> prompt_observer( |
1375 PromptObserver::Create(WebContents())); | 1384 PromptObserver::Create(WebContents())); |
1376 std::string submit = | 1385 std::string submit = |
1377 "document.getElementById('username').value = 'overwrite_me';" | 1386 "document.getElementById('username').value = 'overwrite_me';" |
1378 "document.getElementById('password').value = 'random';" | 1387 "document.getElementById('password').value = 'random';" |
1379 "document.getElementById('non-form-button').click();"; | 1388 "document.getElementById('non-form-button').click();"; |
1380 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); | 1389 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), submit)); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 NavigateToFile("/password/password_xhr_submit.html"); | 1906 NavigateToFile("/password/password_xhr_submit.html"); |
1898 | 1907 |
1899 // Let the user interact with the page, so that DOM gets modification events, | 1908 // Let the user interact with the page, so that DOM gets modification events, |
1900 // needed for autofilling fields. | 1909 // needed for autofilling fields. |
1901 content::SimulateMouseClickAt( | 1910 content::SimulateMouseClickAt( |
1902 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 1911 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); |
1903 | 1912 |
1904 // Wait until that interaction causes the password value to be revealed. | 1913 // Wait until that interaction causes the password value to be revealed. |
1905 WaitForElementValue("password_field", "mypassword"); | 1914 WaitForElementValue("password_field", "mypassword"); |
1906 } | 1915 } |
OLD | NEW |