| 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 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2024 // Verify password is not autofilled | 2024 // Verify password is not autofilled |
| 2025 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 2025 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
| 2026 RenderViewHost(), | 2026 RenderViewHost(), |
| 2027 "sendMessage('get_password');", | 2027 "sendMessage('get_password');", |
| 2028 &empty_password)); | 2028 &empty_password)); |
| 2029 ASSERT_EQ("", empty_password); | 2029 ASSERT_EQ("", empty_password); |
| 2030 } | 2030 } |
| 2031 | 2031 |
| 2032 // Check that a password form in an iframe of same origin will not be | 2032 // Check that a password form in an iframe of same origin will not be |
| 2033 // filled in until user interact with the iframe. | 2033 // filled in until user interact with the iframe. |
| 2034 // TODO(crbug.com/683209): Flaky on Win7 dbg. |
| 2035 #if defined(OS_WIN) |
| 2036 #define MAYBE_SameOriginIframeAutoFillTest DISABLED_SameOriginIframeAutoFillTest |
| 2037 #else |
| 2038 #define MAYBE_SameOriginIframeAutoFillTest SameOriginIframeAutoFillTest |
| 2039 #endif |
| 2034 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, | 2040 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, |
| 2035 SameOriginIframeAutoFillTest) { | 2041 MAYBE_SameOriginIframeAutoFillTest) { |
| 2036 // Visit the sign-up form to store a password for autofill later | 2042 // Visit the sign-up form to store a password for autofill later |
| 2037 NavigateToFile("/password/password_form_in_same_origin_iframe.html"); | 2043 NavigateToFile("/password/password_form_in_same_origin_iframe.html"); |
| 2038 NavigationObserver observer(WebContents()); | 2044 NavigationObserver observer(WebContents()); |
| 2039 observer.SetPathToWaitFor("/password/done.html"); | 2045 observer.SetPathToWaitFor("/password/done.html"); |
| 2040 std::unique_ptr<BubbleObserver> prompt_observer( | 2046 std::unique_ptr<BubbleObserver> prompt_observer( |
| 2041 new BubbleObserver(WebContents())); | 2047 new BubbleObserver(WebContents())); |
| 2042 | 2048 |
| 2043 std::string submit = | 2049 std::string submit = |
| 2044 "var ifrmDoc = document.getElementById('iframe').contentDocument;" | 2050 "var ifrmDoc = document.getElementById('iframe').contentDocument;" |
| 2045 "ifrmDoc.getElementById('username_field').value = 'temp';" | 2051 "ifrmDoc.getElementById('username_field').value = 'temp';" |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3160 // about all frames, not just the main one. The factories should receive | 3166 // about all frames, not just the main one. The factories should receive |
| 3161 // messages for non-main frames, in particular | 3167 // messages for non-main frames, in particular |
| 3162 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the | 3168 // AutofillHostMsg_PasswordFormsParsed. If that were the first time the |
| 3163 // factories hear about such frames, this would crash. | 3169 // factories hear about such frames, this would crash. |
| 3164 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, | 3170 tab_strip_model->AddWebContents(detached_web_contents.release(), -1, |
| 3165 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 3171 ::ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 3166 TabStripModel::ADD_ACTIVE); | 3172 TabStripModel::ADD_ACTIVE); |
| 3167 } | 3173 } |
| 3168 | 3174 |
| 3169 } // namespace password_manager | 3175 } // namespace password_manager |
| OLD | NEW |