Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 1012093005: [Password Manager] Offer to save when an iframe is detached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change upstream Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/password/frame_detached_on_submit.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 "document.getElementById('username_field').value = 'username';" 1767 "document.getElementById('username_field').value = 'username';"
1768 "document.getElementById('password_field').value = 'mypass';" 1768 "document.getElementById('password_field').value = 'mypass';"
1769 "document.getElementById('confirm_field').value = 'mypass';" 1769 "document.getElementById('confirm_field').value = 'mypass';"
1770 "document.getElementById('security_answer').value = 'hometown';" 1770 "document.getElementById('security_answer').value = 'hometown';"
1771 "document.getElementById('SSN').value = '1234';" 1771 "document.getElementById('SSN').value = '1234';"
1772 "document.getElementById('testform').submit();"; 1772 "document.getElementById('testform').submit();";
1773 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit)); 1773 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
1774 observer.Wait(); 1774 observer.Wait();
1775 EXPECT_TRUE(prompt_observer->IsShowingPrompt()); 1775 EXPECT_TRUE(prompt_observer->IsShowingPrompt());
1776 } 1776 }
1777
1778 IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
1779 SaveWhenIFrameDestroyedOnFormSubmit) {
1780 NavigateToFile("/password/frame_detached_on_submit.html");
1781
1782 // Need to pay attention for a message that XHR has finished since there
1783 // is no navigation to wait for.
1784 content::DOMMessageQueue message_queue;
1785
1786 scoped_ptr<PromptObserver> prompt_observer(
1787 PromptObserver::Create(WebContents()));
1788 std::string fill_and_submit =
1789 "var iframe = document.getElementById('login_iframe');"
1790 "var frame_doc = iframe.contentDocument;"
1791 "frame_doc.getElementById('username_field').value = 'temp';"
1792 "frame_doc.getElementById('password_field').value = 'random';"
1793 "frame_doc.getElementById('submit_button').click();";
1794
1795 ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
1796 std::string message;
1797 while (message_queue.WaitForMessage(&message)) {
1798 if (message == "\"SUBMISSION_FINISHED\"")
1799 break;
1800 }
1801
1802 EXPECT_TRUE(prompt_observer->IsShowingPrompt());
1803 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/password/frame_detached_on_submit.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698