OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // there is local data available to use as a baseline. | 107 // there is local data available to use as a baseline. |
108 WindowedPersonalDataManagerObserver personal_data_observer( | 108 WindowedPersonalDataManagerObserver personal_data_observer( |
109 browser()->profile()); | 109 browser()->profile()); |
110 PersonalDataManagerFactory::GetForProfile(browser()->profile()) | 110 PersonalDataManagerFactory::GetForProfile(browser()->profile()) |
111 ->AddProfile(test::GetFullProfile()); | 111 ->AddProfile(test::GetFullProfile()); |
112 personal_data_observer.Wait(); | 112 personal_data_observer.Wait(); |
113 | 113 |
114 // Load the test page. Expect a query request upon loading the page. | 114 // Load the test page. Expect a query request upon loading the page. |
115 const char kDataURIPrefix[] = "data:text/html;charset=utf-8,"; | 115 const char kDataURIPrefix[] = "data:text/html;charset=utf-8,"; |
116 const char kFormHtml[] = | 116 const char kFormHtml[] = |
117 "<form id='test_form'>" | 117 "<form id='test_form' action='about:blank'>" |
118 " <input id='one'>" | 118 " <input id='one'>" |
119 " <input id='two' autocomplete='off'>" | 119 " <input id='two' autocomplete='off'>" |
120 " <input id='three'>" | 120 " <input id='three'>" |
121 " <input id='four' autocomplete='off'>" | 121 " <input id='four' autocomplete='off'>" |
122 " <input type='submit'>" | 122 " <input type='submit'>" |
123 "</form>" | 123 "</form>" |
124 "<script>" | 124 "<script>" |
125 " document.onclick = function() {" | 125 " document.onclick = function() {" |
126 " document.getElementById('test_form').submit();" | 126 " document.getElementById('test_form').submit();" |
127 " };" | 127 " };" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 std::string expected_query_string; | 205 std::string expected_query_string; |
206 ASSERT_TRUE(query.SerializeToString(&expected_query_string)); | 206 ASSERT_TRUE(query.SerializeToString(&expected_query_string)); |
207 | 207 |
208 WindowedNetworkObserver query_network_observer(expected_query_string); | 208 WindowedNetworkObserver query_network_observer(expected_query_string); |
209 ui_test_utils::NavigateToURL( | 209 ui_test_utils::NavigateToURL( |
210 browser(), GURL(std::string(kDataURIPrefix) + kFormHtml)); | 210 browser(), GURL(std::string(kDataURIPrefix) + kFormHtml)); |
211 query_network_observer.Wait(); | 211 query_network_observer.Wait(); |
212 } | 212 } |
213 | 213 |
214 } // namespace autofill | 214 } // namespace autofill |
OLD | NEW |