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 "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_external_delegate_views.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/autofill/autofill_manager.h" | 8 #include "chrome/browser/autofill/autofill_manager.h" |
9 #include "chrome/browser/autofill/test_autofill_external_delegate.h" | 9 #include "chrome/browser/autofill/test_autofill_external_delegate.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 }; | 64 }; |
65 | 65 |
66 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, | 66 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, |
67 OpenAndClosePopup) { | 67 OpenAndClosePopup) { |
68 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 68 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
69 | 69 |
70 autofill_external_delegate_->HideAutofillPopup(); | 70 autofill_external_delegate_->HideAutofillPopup(); |
71 EXPECT_TRUE(autofill_external_delegate_->popup_hidden_); | 71 EXPECT_TRUE(autofill_external_delegate_->popup_hidden_); |
72 } | 72 } |
73 | 73 |
| 74 // See http://crbug.com/164019 |
| 75 #if !defined(USE_AURA) |
74 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, | 76 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, |
75 CloseWidgetAndNoLeaking) { | 77 CloseWidgetAndNoLeaking) { |
76 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 78 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
77 | |
78 // Delete the widget to ensure that the external delegate can handle the | 79 // Delete the widget to ensure that the external delegate can handle the |
79 // popup getting deleted elsewhere and the . | 80 // popup getting deleted elsewhere. |
80 views::Widget* popup_widget = | 81 views::Widget* popup_widget = |
81 autofill_external_delegate_->popup_view()->GetWidget(); | 82 autofill_external_delegate_->popup_view()->GetWidget(); |
82 popup_widget->CloseNow(); | 83 popup_widget->CloseNow(); |
83 | 84 |
84 EXPECT_TRUE(autofill_external_delegate_->popup_hidden_); | 85 EXPECT_TRUE(autofill_external_delegate_->popup_hidden_); |
85 } | 86 } |
| 87 #endif // !defined(USE_AURA) |
86 | 88 |
87 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, | 89 IN_PROC_BROWSER_TEST_F(AutofillExternalDelegateViewsBrowserTest, |
88 HandlePopupClosingAndChangingPages) { | 90 HandlePopupClosingAndChangingPages) { |
89 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 91 autofill::GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
90 | 92 |
91 // Close popup. | 93 // Close popup. |
92 autofill_external_delegate_->HideAutofillPopup(); | 94 autofill_external_delegate_->HideAutofillPopup(); |
93 | 95 |
94 // Navigate to a new page | 96 // Navigate to a new page |
95 content::WindowedNotificationObserver observer( | 97 content::WindowedNotificationObserver observer( |
96 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 98 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
97 content::Source<content::NavigationController>( | 99 content::Source<content::NavigationController>( |
98 &(web_contents_->GetController()))); | 100 &(web_contents_->GetController()))); |
99 browser()->OpenURL(content::OpenURLParams( | 101 browser()->OpenURL(content::OpenURLParams( |
100 GURL(chrome::kAboutBlankURL), content::Referrer(), | 102 GURL(chrome::kAboutBlankURL), content::Referrer(), |
101 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 103 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
102 observer.Wait(); | 104 observer.Wait(); |
103 } | 105 } |
OLD | NEW |