OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 " send('');" | 318 " send('');" |
319 "};" | 319 "};" |
320 "</script>" | 320 "</script>" |
321 "</body>" | 321 "</body>" |
322 "</html>")); | 322 "</html>")); |
323 content::WaitForLoadStop(contents); | 323 content::WaitForLoadStop(contents); |
324 | 324 |
325 dom_message_queue_.reset(new content::DOMMessageQueue); | 325 dom_message_queue_.reset(new content::DOMMessageQueue); |
326 | 326 |
327 // Triggers the onclick handler which invokes requestAutocomplete(). | 327 // Triggers the onclick handler which invokes requestAutocomplete(). |
328 content::SimulateMouseClick(contents, 0, WebKit::WebMouseEvent::ButtonLeft); | 328 content::SimulateMouseClick(contents, 0, blink::WebMouseEvent::ButtonLeft); |
329 ExpectDomMessage("clicked"); | 329 ExpectDomMessage("clicked"); |
330 | 330 |
331 AutofillDialogControllerImpl* controller = | 331 AutofillDialogControllerImpl* controller = |
332 static_cast<AutofillDialogControllerImpl*>( | 332 static_cast<AutofillDialogControllerImpl*>( |
333 delegate->GetDialogControllerForTesting()); | 333 delegate->GetDialogControllerForTesting()); |
334 DCHECK(controller); | 334 DCHECK(controller); |
335 return controller; | 335 return controller; |
336 } | 336 } |
337 | 337 |
338 // Wait for a message from the DOM automation controller (from JS in the | 338 // Wait for a message from the DOM automation controller (from JS in the |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 test::GetVerifiedProfile()); | 975 test::GetVerifiedProfile()); |
976 | 976 |
977 TestableAutofillDialogView* view = controller->GetTestableView(); | 977 TestableAutofillDialogView* view = controller->GetTestableView(); |
978 view->SetTextContentsOfSuggestionInput(SECTION_CC, ASCIIToUTF16("123")); | 978 view->SetTextContentsOfSuggestionInput(SECTION_CC, ASCIIToUTF16("123")); |
979 view->SubmitForTesting(); | 979 view->SubmitForTesting(); |
980 ExpectDomMessage("success"); | 980 ExpectDomMessage("success"); |
981 EXPECT_EQ("123", GetValueForHTMLFieldOfType("cc-csc")); | 981 EXPECT_EQ("123", GetValueForHTMLFieldOfType("cc-csc")); |
982 } | 982 } |
983 | 983 |
984 } // namespace autofill | 984 } // namespace autofill |
OLD | NEW |