| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 bool ScrollbarTest::IsScrollbarVisible() { | 163 bool ScrollbarTest::IsScrollbarVisible() { |
| 164 ExtensionInstallPrompt::ShowParams show_params(web_contents()); | 164 ExtensionInstallPrompt::ShowParams show_params(web_contents()); |
| 165 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( | 165 ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( |
| 166 show_params.profile, | 166 show_params.profile, |
| 167 show_params.parent_web_contents, | 167 show_params.parent_web_contents, |
| 168 delegate(), | 168 delegate(), |
| 169 prompt()); | 169 prompt()); |
| 170 | 170 |
| 171 // Create the modal view around the install dialog view. | 171 // Create the modal view around the install dialog view. |
| 172 views::Widget* modal = | 172 views::Widget* modal = |
| 173 CreateBrowserModalDialogViews(dialog, show_params.parent_window); | 173 CreateWindowModalDialogViews(dialog, show_params.parent_window); |
| 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 |