| 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 "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" | 5 #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_icon_manager.h" | 9 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 bool ScrollbarTest::IsScrollbarVisible() { | 163 bool ScrollbarTest::IsScrollbarVisible() { |
| 164 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( | 164 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( |
| 165 profile(), | 165 profile(), |
| 166 web_contents(), | 166 web_contents(), |
| 167 delegate(), | 167 delegate(), |
| 168 prompt()); | 168 prompt()); |
| 169 | 169 |
| 170 // Create the modal view around the install dialog view. | 170 // Create the modal view around the install dialog view. |
| 171 views::Widget* modal = | 171 views::Widget* modal = |
| 172 CreateBrowserModalDialogViews(dialog, | 172 CreateWindowModalDialogViews(dialog, |
| 173 web_contents()->GetTopLevelNativeWindow()); | 173 web_contents()->GetTopLevelNativeWindow()); |
| 174 modal->Show(); | 174 modal->Show(); |
| 175 content::RunAllBlockingPoolTasksUntilIdle(); | 175 content::RunAllBlockingPoolTasksUntilIdle(); |
| 176 | 176 |
| 177 // Check if the vertical scrollbar is visible. | 177 // Check if the vertical scrollbar is visible. |
| 178 return dialog->scroll_view()->vertical_scroll_bar()->visible(); | 178 return dialog->scroll_view()->vertical_scroll_bar()->visible(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 // Tests that a scrollbar _is_ shown for an excessively long extension | 181 // Tests that a scrollbar _is_ shown for an excessively long extension |
| 182 // install prompt. | 182 // install prompt. |
| 183 IN_PROC_BROWSER_TEST_F(ScrollbarTest, LongPromptScrollbar) { | 183 IN_PROC_BROWSER_TEST_F(ScrollbarTest, LongPromptScrollbar) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 MockExtensionInstallPromptDelegate delegate; | 260 MockExtensionInstallPromptDelegate delegate; |
| 261 scoped_ptr<ExtensionInstallDialogView> dialog( | 261 scoped_ptr<ExtensionInstallDialogView> dialog( |
| 262 new ExtensionInstallDialogView( | 262 new ExtensionInstallDialogView( |
| 263 profile(), web_contents(), &delegate, prompt())); | 263 profile(), web_contents(), &delegate, prompt())); |
| 264 dialog.reset(); | 264 dialog.reset(); |
| 265 | 265 |
| 266 EXPECT_EQ(1, delegate.abort_count()); | 266 EXPECT_EQ(1, delegate.abort_count()); |
| 267 EXPECT_EQ(0, delegate.proceed_count()); | 267 EXPECT_EQ(0, delegate.proceed_count()); |
| 268 } | 268 } |
| 269 } | 269 } |
| OLD | NEW |