Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" | |
| 6 | |
| 7 #include "base/memory/scoped_ptr.h" | |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents.h" | |
| 9 #include "chrome/browser/ui/browser_tabstrip.h" | |
| 10 #include "chrome/test/base/in_process_browser_test.h" | |
| 11 #include "testing/gtest/include/gtest/gtest.h" | |
| 12 #include "ui/gfx/rect.h" | |
| 13 | |
| 14 class AutofillExternalDelegateViewsBrowserTest : public InProcessBrowserTest { | |
|
sky
2012/08/16 23:02:01
use a typedef so that you don't need a class.
csharp
2012/08/20 20:59:00
Done.
| |
| 15 public: | |
| 16 AutofillExternalDelegateViewsBrowserTest() {} | |
| 17 virtual ~AutofillExternalDelegateViewsBrowserTest() {} | |
| 18 }; | |
| 19 | |
| 20 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, | |
| 21 OpenAndClosePopup) { | |
| 22 TabContents* tab_contents_ = chrome::GetActiveTabContents(browser()); | |
| 23 ASSERT_TRUE(tab_contents_ != NULL); | |
| 24 | |
| 25 scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_( | |
| 26 AutofillExternalDelegate::Create(tab_contents_, NULL)); | |
| 27 | |
| 28 int query_id = 1; | |
| 29 webkit::forms::FormData form; | |
| 30 webkit::forms::FormField field; | |
| 31 field.is_focusable = true; | |
| 32 field.should_autocomplete = true; | |
| 33 gfx::Rect bounds(100, 100); | |
| 34 | |
| 35 // Ensure that we can populate the popup through the delegate without any | |
| 36 // and then close it. | |
| 37 autofill_external_delegate_->OnQuery(query_id, form, field, bounds, false); | |
| 38 | |
| 39 std::vector<string16> autofill_item; | |
| 40 autofill_item.push_back(string16()); | |
| 41 std::vector<int> autofill_id; | |
| 42 autofill_id.push_back(0); | |
| 43 autofill_external_delegate_->OnSuggestionsReturned( | |
| 44 query_id, autofill_item, autofill_item, autofill_item, autofill_id); | |
| 45 | |
| 46 autofill_external_delegate_->HideAutofillPopup(); | |
| 47 } | |
| OLD | NEW |