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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 std::unique_ptr<ExtensionInstallPrompt::Prompt> | 74 std::unique_ptr<ExtensionInstallPrompt::Prompt> |
75 ExtensionInstallDialogViewTestBase::CreatePrompt() { | 75 ExtensionInstallDialogViewTestBase::CreatePrompt() { |
76 std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt( | 76 std::unique_ptr<ExtensionInstallPrompt::Prompt> prompt( |
77 new ExtensionInstallPrompt::Prompt(prompt_type_)); | 77 new ExtensionInstallPrompt::Prompt(prompt_type_)); |
78 prompt->set_extension(extension_); | 78 prompt->set_extension(extension_); |
79 | 79 |
80 std::unique_ptr<ExtensionIconManager> icon_manager( | 80 std::unique_ptr<ExtensionIconManager> icon_manager( |
81 new ExtensionIconManager()); | 81 new ExtensionIconManager()); |
82 const SkBitmap icon_bitmap = icon_manager->GetIcon(extension_->id()); | 82 prompt->set_icon(icon_manager->GetIcon(extension_->id())); |
83 gfx::Image icon = gfx::Image::CreateFrom1xBitmap(icon_bitmap); | |
84 prompt->set_icon(icon); | |
85 | 83 |
86 return prompt; | 84 return prompt; |
87 } | 85 } |
88 | 86 |
89 class ScrollbarTest : public ExtensionInstallDialogViewTestBase { | 87 class ScrollbarTest : public ExtensionInstallDialogViewTestBase { |
90 protected: | 88 protected: |
91 ScrollbarTest(); | 89 ScrollbarTest(); |
92 ~ScrollbarTest() override {} | 90 ~ScrollbarTest() override {} |
93 | 91 |
94 bool IsScrollbarVisible( | 92 bool IsScrollbarVisible( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 { | 195 { |
198 // Dialog is closed without the user explicitly choosing to proceed or | 196 // Dialog is closed without the user explicitly choosing to proceed or |
199 // cancel. | 197 // cancel. |
200 ExtensionInstallPromptTestHelper helper; | 198 ExtensionInstallPromptTestHelper helper; |
201 views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper); | 199 views::DialogDelegateView* delegate_view = CreateAndShowPrompt(&helper); |
202 delegate_view->GetWidget()->Close(); | 200 delegate_view->GetWidget()->Close(); |
203 // TODO(devlin): Should this be ABORTED? | 201 // TODO(devlin): Should this be ABORTED? |
204 EXPECT_EQ(ExtensionInstallPrompt::Result::USER_CANCELED, helper.result()); | 202 EXPECT_EQ(ExtensionInstallPrompt::Result::USER_CANCELED, helper.result()); |
205 } | 203 } |
206 } | 204 } |
OLD | NEW |