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 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 first_observer.Wait(); | 842 first_observer.Wait(); |
843 EXPECT_TRUE(prompt_observer->IsShowingSavePrompt()); | 843 EXPECT_TRUE(prompt_observer->IsShowingSavePrompt()); |
844 prompt_observer->AcceptSavePrompt(); | 844 prompt_observer->AcceptSavePrompt(); |
845 | 845 |
846 // Now navigate to a login form that has similar HTML markup. | 846 // Now navigate to a login form that has similar HTML markup. |
847 NavigateToFile("/password/password_form.html"); | 847 NavigateToFile("/password/password_form.html"); |
848 | 848 |
849 // Simulate a user click to force an autofill of the form's DOM value, not | 849 // Simulate a user click to force an autofill of the form's DOM value, not |
850 // just the suggested value. | 850 // just the suggested value. |
851 content::SimulateMouseClick( | 851 content::SimulateMouseClick( |
852 WebContents(), 0, blink::WebMouseEvent::ButtonLeft); | 852 WebContents(), 0, blink::WebMouseEvent::Button::Left); |
853 | 853 |
854 // The form should be filled with the previously submitted username. | 854 // The form should be filled with the previously submitted username. |
855 std::string get_username = | 855 std::string get_username = |
856 "window.domAutomationController.send(" | 856 "window.domAutomationController.send(" |
857 "document.getElementById('username_field').value);"; | 857 "document.getElementById('username_field').value);"; |
858 std::string actual_username; | 858 std::string actual_username; |
859 ASSERT_TRUE(content::ExecuteScriptAndExtractString(RenderViewHost(), | 859 ASSERT_TRUE(content::ExecuteScriptAndExtractString(RenderViewHost(), |
860 get_username, | 860 get_username, |
861 &actual_username)); | 861 &actual_username)); |
862 ASSERT_EQ("my_username", actual_username); | 862 ASSERT_EQ("my_username", actual_username); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 NavigationObserver reload_observer(WebContents()); | 1083 NavigationObserver reload_observer(WebContents()); |
1084 NavigateToFile("/password/form_and_link.html"); | 1084 NavigateToFile("/password/form_and_link.html"); |
1085 reload_observer.Wait(); | 1085 reload_observer.Wait(); |
1086 | 1086 |
1087 // Wait until the username is filled, to make sure autofill kicked in. | 1087 // Wait until the username is filled, to make sure autofill kicked in. |
1088 WaitForElementValue("username_field", "temp"); | 1088 WaitForElementValue("username_field", "temp"); |
1089 // Now check that the password is not accessible yet. | 1089 // Now check that the password is not accessible yet. |
1090 CheckElementValue("password_field", ""); | 1090 CheckElementValue("password_field", ""); |
1091 // Let the user interact with the page. | 1091 // Let the user interact with the page. |
1092 content::SimulateMouseClickAt( | 1092 content::SimulateMouseClickAt( |
1093 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 1093 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
1094 // Wait until that interaction causes the password value to be revealed. | 1094 // Wait until that interaction causes the password value to be revealed. |
1095 WaitForElementValue("password_field", "random"); | 1095 WaitForElementValue("password_field", "random"); |
1096 // And check that after the side-effects of the interaction took place, the | 1096 // And check that after the side-effects of the interaction took place, the |
1097 // username value stays the same. | 1097 // username value stays the same. |
1098 CheckElementValue("username_field", "temp"); | 1098 CheckElementValue("username_field", "temp"); |
1099 } | 1099 } |
1100 | 1100 |
1101 // The following test is limited to Aura, because | 1101 // The following test is limited to Aura, because |
1102 // RenderWidgetHostViewGuest::ProcessAckedTouchEvent is, and | 1102 // RenderWidgetHostViewGuest::ProcessAckedTouchEvent is, and |
1103 // ProcessAckedTouchEvent is what triggers the translation of touch events to | 1103 // ProcessAckedTouchEvent is what triggers the translation of touch events to |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 RenderViewHost(), | 1676 RenderViewHost(), |
1677 "window.domAutomationController.send(usernameRect.top);", | 1677 "window.domAutomationController.send(usernameRect.top);", |
1678 &top)); | 1678 &top)); |
1679 int left; | 1679 int left; |
1680 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 1680 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
1681 RenderViewHost(), | 1681 RenderViewHost(), |
1682 "window.domAutomationController.send(usernameRect.left);", | 1682 "window.domAutomationController.send(usernameRect.left);", |
1683 &left)); | 1683 &left)); |
1684 | 1684 |
1685 content::SimulateMouseClickAt( | 1685 content::SimulateMouseClickAt( |
1686 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(left + 1, | 1686 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(left + 1, |
1687 top + 1)); | 1687 top + 1)); |
1688 // Make sure the popup would be shown. | 1688 // Make sure the popup would be shown. |
1689 observing_autofill_client.Wait(); | 1689 observing_autofill_client.Wait(); |
1690 } | 1690 } |
1691 | 1691 |
1692 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, | 1692 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, |
1693 ChangePwdFormBubbleShown) { | 1693 ChangePwdFormBubbleShown) { |
1694 NavigateToFile("/password/password_form.html"); | 1694 NavigateToFile("/password/password_form.html"); |
1695 | 1695 |
1696 NavigationObserver observer(WebContents()); | 1696 NavigationObserver observer(WebContents()); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 RenderViewHost(), | 1923 RenderViewHost(), |
1924 "window.domAutomationController.send(iframeRect.top);", | 1924 "window.domAutomationController.send(iframeRect.top);", |
1925 &top)); | 1925 &top)); |
1926 int left; | 1926 int left; |
1927 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 1927 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
1928 RenderViewHost(), | 1928 RenderViewHost(), |
1929 "window.domAutomationController.send(iframeRect.left);", | 1929 "window.domAutomationController.send(iframeRect.left);", |
1930 &left)); | 1930 &left)); |
1931 | 1931 |
1932 content::SimulateMouseClickAt( | 1932 content::SimulateMouseClickAt( |
1933 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(left + 1, | 1933 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(left + 1, |
1934 top + 1)); | 1934 top + 1)); |
1935 // Verify username is not autofilled | 1935 // Verify username is not autofilled |
1936 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 1936 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
1937 RenderViewHost(), | 1937 RenderViewHost(), |
1938 "sendMessage('get_username');", | 1938 "sendMessage('get_username');", |
1939 &empty_username)); | 1939 &empty_username)); |
1940 ASSERT_EQ("", empty_username); | 1940 ASSERT_EQ("", empty_username); |
1941 // Verify password is not autofilled | 1941 // Verify password is not autofilled |
1942 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 1942 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
1943 RenderViewHost(), | 1943 RenderViewHost(), |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 RenderViewHost(), | 1988 RenderViewHost(), |
1989 "window.domAutomationController.send(iframeRect.top);", | 1989 "window.domAutomationController.send(iframeRect.top);", |
1990 &top)); | 1990 &top)); |
1991 int left; | 1991 int left; |
1992 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( | 1992 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( |
1993 RenderViewHost(), | 1993 RenderViewHost(), |
1994 "window.domAutomationController.send(iframeRect.left);", | 1994 "window.domAutomationController.send(iframeRect.left);", |
1995 &left)); | 1995 &left)); |
1996 | 1996 |
1997 content::SimulateMouseClickAt( | 1997 content::SimulateMouseClickAt( |
1998 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(left + 1, | 1998 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(left + 1, |
1999 top + 1)); | 1999 top + 1)); |
2000 // Verify password has been autofilled | 2000 // Verify password has been autofilled |
2001 WaitForElementValue("iframe", "password_field", "pa55w0rd"); | 2001 WaitForElementValue("iframe", "password_field", "pa55w0rd"); |
2002 | 2002 |
2003 // Verify username has been autofilled | 2003 // Verify username has been autofilled |
2004 CheckElementValue("iframe", "username_field", "temp"); | 2004 CheckElementValue("iframe", "username_field", "temp"); |
2005 } | 2005 } |
2006 | 2006 |
2007 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoFormElementTest) { | 2007 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoFormElementTest) { |
2008 std::string submit = | 2008 std::string submit = |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 base::RunLoop run_loop; | 2292 base::RunLoop run_loop; |
2293 run_loop.RunUntilIdle(); | 2293 run_loop.RunUntilIdle(); |
2294 | 2294 |
2295 // Now, navigate to the password form having ambiguous Ids for username and | 2295 // Now, navigate to the password form having ambiguous Ids for username and |
2296 // password fields and verify whether username and password is autofilled. | 2296 // password fields and verify whether username and password is autofilled. |
2297 NavigateToFile("/password/ambiguous_password_form.html"); | 2297 NavigateToFile("/password/ambiguous_password_form.html"); |
2298 | 2298 |
2299 // Let the user interact with the page, so that DOM gets modification events, | 2299 // Let the user interact with the page, so that DOM gets modification events, |
2300 // needed for autofilling fields. | 2300 // needed for autofilling fields. |
2301 content::SimulateMouseClickAt( | 2301 content::SimulateMouseClickAt( |
2302 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2302 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2303 | 2303 |
2304 std::string get_username = | 2304 std::string get_username = |
2305 "window.domAutomationController.send(" | 2305 "window.domAutomationController.send(" |
2306 " document.getElementById('ambiguous_form').elements[0].value);"; | 2306 " document.getElementById('ambiguous_form').elements[0].value);"; |
2307 std::string actual_username; | 2307 std::string actual_username; |
2308 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2308 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2309 RenderViewHost(), get_username, &actual_username)); | 2309 RenderViewHost(), get_username, &actual_username)); |
2310 EXPECT_EQ("myusername", actual_username); | 2310 EXPECT_EQ("myusername", actual_username); |
2311 | 2311 |
2312 std::string get_password = | 2312 std::string get_password = |
(...skipping 27 matching lines...) Expand all Loading... |
2340 base::RunLoop run_loop; | 2340 base::RunLoop run_loop; |
2341 run_loop.RunUntilIdle(); | 2341 run_loop.RunUntilIdle(); |
2342 | 2342 |
2343 // Now, navigate to the password form having no Ids for username and password | 2343 // Now, navigate to the password form having no Ids for username and password |
2344 // fields and verify whether username and password is autofilled. | 2344 // fields and verify whether username and password is autofilled. |
2345 NavigateToFile("/password/ambiguous_password_form.html"); | 2345 NavigateToFile("/password/ambiguous_password_form.html"); |
2346 | 2346 |
2347 // Let the user interact with the page, so that DOM gets modification events, | 2347 // Let the user interact with the page, so that DOM gets modification events, |
2348 // needed for autofilling fields. | 2348 // needed for autofilling fields. |
2349 content::SimulateMouseClickAt( | 2349 content::SimulateMouseClickAt( |
2350 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2350 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2351 | 2351 |
2352 std::string get_username = | 2352 std::string get_username = |
2353 "window.domAutomationController.send(" | 2353 "window.domAutomationController.send(" |
2354 " document.getElementById('no_name_id_form').elements[0].value);"; | 2354 " document.getElementById('no_name_id_form').elements[0].value);"; |
2355 std::string actual_username; | 2355 std::string actual_username; |
2356 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2356 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2357 RenderViewHost(), get_username, &actual_username)); | 2357 RenderViewHost(), get_username, &actual_username)); |
2358 EXPECT_EQ("myusername", actual_username); | 2358 EXPECT_EQ("myusername", actual_username); |
2359 | 2359 |
2360 std::string get_password = | 2360 std::string get_password = |
(...skipping 26 matching lines...) Expand all Loading... |
2387 base::RunLoop run_loop; | 2387 base::RunLoop run_loop; |
2388 run_loop.RunUntilIdle(); | 2388 run_loop.RunUntilIdle(); |
2389 | 2389 |
2390 // Now, navigate to the password form having no Ids for username and password | 2390 // Now, navigate to the password form having no Ids for username and password |
2391 // fields and verify whether username and password is autofilled. | 2391 // fields and verify whether username and password is autofilled. |
2392 NavigateToFile("/password/ambiguous_password_form.html"); | 2392 NavigateToFile("/password/ambiguous_password_form.html"); |
2393 | 2393 |
2394 // Let the user interact with the page, so that DOM gets modification events, | 2394 // Let the user interact with the page, so that DOM gets modification events, |
2395 // needed for autofilling fields. | 2395 // needed for autofilling fields. |
2396 content::SimulateMouseClickAt( | 2396 content::SimulateMouseClickAt( |
2397 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2397 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2398 | 2398 |
2399 std::string get_username = | 2399 std::string get_username = |
2400 "window.domAutomationController.send(" | 2400 "window.domAutomationController.send(" |
2401 " document.getElementById(" | 2401 " document.getElementById(" |
2402 " 'change_pwd_but_no_autocomplete').elements[0].value);"; | 2402 " 'change_pwd_but_no_autocomplete').elements[0].value);"; |
2403 std::string actual_username; | 2403 std::string actual_username; |
2404 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2404 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2405 RenderViewHost(), get_username, &actual_username)); | 2405 RenderViewHost(), get_username, &actual_username)); |
2406 EXPECT_EQ("myusername", actual_username); | 2406 EXPECT_EQ("myusername", actual_username); |
2407 | 2407 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2447 base::RunLoop run_loop; | 2447 base::RunLoop run_loop; |
2448 run_loop.RunUntilIdle(); | 2448 run_loop.RunUntilIdle(); |
2449 | 2449 |
2450 // Now, navigate to the password form having no Ids for username and password | 2450 // Now, navigate to the password form having no Ids for username and password |
2451 // fields and verify whether username and password is autofilled. | 2451 // fields and verify whether username and password is autofilled. |
2452 NavigateToFile("/password/ambiguous_password_form.html"); | 2452 NavigateToFile("/password/ambiguous_password_form.html"); |
2453 | 2453 |
2454 // Let the user interact with the page, so that DOM gets modification events, | 2454 // Let the user interact with the page, so that DOM gets modification events, |
2455 // needed for autofilling fields. | 2455 // needed for autofilling fields. |
2456 content::SimulateMouseClickAt( | 2456 content::SimulateMouseClickAt( |
2457 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2457 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2458 | 2458 |
2459 std::string get_username = | 2459 std::string get_username = |
2460 "window.domAutomationController.send(" | 2460 "window.domAutomationController.send(" |
2461 " document.getElementById('change_pwd').elements[0].value);"; | 2461 " document.getElementById('change_pwd').elements[0].value);"; |
2462 std::string actual_username; | 2462 std::string actual_username; |
2463 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2463 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2464 RenderViewHost(), get_username, &actual_username)); | 2464 RenderViewHost(), get_username, &actual_username)); |
2465 EXPECT_EQ("myusername", actual_username); | 2465 EXPECT_EQ("myusername", actual_username); |
2466 | 2466 |
2467 std::string get_password = | 2467 std::string get_password = |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2504 base::RunLoop run_loop; | 2504 base::RunLoop run_loop; |
2505 run_loop.RunUntilIdle(); | 2505 run_loop.RunUntilIdle(); |
2506 | 2506 |
2507 // Now, navigate to the password form having no Ids for username and password | 2507 // Now, navigate to the password form having no Ids for username and password |
2508 // fields and verify whether username and password is autofilled. | 2508 // fields and verify whether username and password is autofilled. |
2509 NavigateToFile("/password/ambiguous_password_form.html"); | 2509 NavigateToFile("/password/ambiguous_password_form.html"); |
2510 | 2510 |
2511 // Let the user interact with the page, so that DOM gets modification events, | 2511 // Let the user interact with the page, so that DOM gets modification events, |
2512 // needed for autofilling fields. | 2512 // needed for autofilling fields. |
2513 content::SimulateMouseClickAt( | 2513 content::SimulateMouseClickAt( |
2514 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2514 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2515 | 2515 |
2516 std::string get_username = | 2516 std::string get_username = |
2517 "window.domAutomationController.send(" | 2517 "window.domAutomationController.send(" |
2518 " document.getElementById(" | 2518 " document.getElementById(" |
2519 " 'change_pwd_but_no_old_pwd').elements[0].value);"; | 2519 " 'change_pwd_but_no_old_pwd').elements[0].value);"; |
2520 std::string actual_username; | 2520 std::string actual_username; |
2521 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2521 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2522 RenderViewHost(), get_username, &actual_username)); | 2522 RenderViewHost(), get_username, &actual_username)); |
2523 EXPECT_EQ("", actual_username); | 2523 EXPECT_EQ("", actual_username); |
2524 | 2524 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 base::RunLoop run_loop; | 2622 base::RunLoop run_loop; |
2623 run_loop.RunUntilIdle(); | 2623 run_loop.RunUntilIdle(); |
2624 | 2624 |
2625 // Now, navigate to the hidden password form and verify whether username and | 2625 // Now, navigate to the hidden password form and verify whether username and |
2626 // password is autofilled. | 2626 // password is autofilled. |
2627 NavigateToFile("/password/password_form.html"); | 2627 NavigateToFile("/password/password_form.html"); |
2628 | 2628 |
2629 // Let the user interact with the page, so that DOM gets modification events, | 2629 // Let the user interact with the page, so that DOM gets modification events, |
2630 // needed for autofilling fields. | 2630 // needed for autofilling fields. |
2631 content::SimulateMouseClickAt( | 2631 content::SimulateMouseClickAt( |
2632 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2632 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2633 | 2633 |
2634 std::string get_username = | 2634 std::string get_username = |
2635 "window.domAutomationController.send(" | 2635 "window.domAutomationController.send(" |
2636 " document.getElementById('hidden_password_form_username').value);"; | 2636 " document.getElementById('hidden_password_form_username').value);"; |
2637 std::string actual_username; | 2637 std::string actual_username; |
2638 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2638 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2639 RenderViewHost(), get_username, &actual_username)); | 2639 RenderViewHost(), get_username, &actual_username)); |
2640 EXPECT_EQ("myusername", actual_username); | 2640 EXPECT_EQ("myusername", actual_username); |
2641 | 2641 |
2642 std::string get_password = | 2642 std::string get_password = |
(...skipping 26 matching lines...) Expand all Loading... |
2669 base::RunLoop run_loop; | 2669 base::RunLoop run_loop; |
2670 run_loop.RunUntilIdle(); | 2670 run_loop.RunUntilIdle(); |
2671 | 2671 |
2672 // Now, navigate to the password form with a hidden password field and verify | 2672 // Now, navigate to the password form with a hidden password field and verify |
2673 // whether username and password is autofilled. | 2673 // whether username and password is autofilled. |
2674 NavigateToFile("/password/password_form.html"); | 2674 NavigateToFile("/password/password_form.html"); |
2675 | 2675 |
2676 // Let the user interact with the page, so that DOM gets modification events, | 2676 // Let the user interact with the page, so that DOM gets modification events, |
2677 // needed for autofilling fields. | 2677 // needed for autofilling fields. |
2678 content::SimulateMouseClickAt( | 2678 content::SimulateMouseClickAt( |
2679 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2679 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2680 | 2680 |
2681 std::string get_username = | 2681 std::string get_username = |
2682 "window.domAutomationController.send(" | 2682 "window.domAutomationController.send(" |
2683 " document.getElementById('form_with_hidden_password_username').value);"; | 2683 " document.getElementById('form_with_hidden_password_username').value);"; |
2684 std::string actual_username; | 2684 std::string actual_username; |
2685 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2685 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2686 RenderViewHost(), get_username, &actual_username)); | 2686 RenderViewHost(), get_username, &actual_username)); |
2687 EXPECT_EQ("myusername", actual_username); | 2687 EXPECT_EQ("myusername", actual_username); |
2688 | 2688 |
2689 std::string get_password = | 2689 std::string get_password = |
(...skipping 26 matching lines...) Expand all Loading... |
2716 base::RunLoop run_loop; | 2716 base::RunLoop run_loop; |
2717 run_loop.RunUntilIdle(); | 2717 run_loop.RunUntilIdle(); |
2718 | 2718 |
2719 // Now, navigate to the password form having ambiguous Ids for username and | 2719 // Now, navigate to the password form having ambiguous Ids for username and |
2720 // password fields and verify whether username and password is autofilled. | 2720 // password fields and verify whether username and password is autofilled. |
2721 NavigateToFile("/password/ambiguous_password_form.html"); | 2721 NavigateToFile("/password/ambiguous_password_form.html"); |
2722 | 2722 |
2723 // Let the user interact with the page, so that DOM gets modification events, | 2723 // Let the user interact with the page, so that DOM gets modification events, |
2724 // needed for autofilling fields. | 2724 // needed for autofilling fields. |
2725 content::SimulateMouseClickAt( | 2725 content::SimulateMouseClickAt( |
2726 WebContents(), 0, blink::WebMouseEvent::ButtonLeft, gfx::Point(1, 1)); | 2726 WebContents(), 0, blink::WebMouseEvent::Button::Left, gfx::Point(1, 1)); |
2727 | 2727 |
2728 std::string get_username = | 2728 std::string get_username = |
2729 "window.domAutomationController.send(" | 2729 "window.domAutomationController.send(" |
2730 " document.getElementById('hidden_password_form').elements[0].value);"; | 2730 " document.getElementById('hidden_password_form').elements[0].value);"; |
2731 std::string actual_username; | 2731 std::string actual_username; |
2732 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2732 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
2733 RenderViewHost(), get_username, &actual_username)); | 2733 RenderViewHost(), get_username, &actual_username)); |
2734 EXPECT_EQ("myusername", actual_username); | 2734 EXPECT_EQ("myusername", actual_username); |
2735 | 2735 |
2736 std::string get_password = | 2736 std::string get_password = |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3046 // about all frames, not just the main one. The factories should receive | 3046 // about all frames, not just the main one. The factories should receive |
3047 // messages for non-main frames, in particular | 3047 // messages for non-main frames, in particular |
3048 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the | 3048 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the |
3049 // factories hear about such frames, this would crash. | 3049 // factories hear about such frames, this would crash. |
3050 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, | 3050 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, |
3051 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 3051 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
3052 TabStripModel::ADD_ACTIVE); | 3052 TabStripModel::ADD_ACTIVE); |
3053 } | 3053 } |
3054 | 3054 |
3055 } // namespace password_manager | 3055 } // namespace password_manager |
OLD | NEW |