| 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/desktop_media_picker_views.h" | 5 #include "chrome/browser/ui/views/desktop_media_picker_views.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 ~DesktopMediaPickerViewsTest() override {} | 29 ~DesktopMediaPickerViewsTest() override {} |
| 30 | 30 |
| 31 void SetUp() override { | 31 void SetUp() override { |
| 32 media_list_ = new FakeDesktopMediaList(); | 32 media_list_ = new FakeDesktopMediaList(); |
| 33 scoped_ptr<FakeDesktopMediaList> media_list(media_list_); | 33 scoped_ptr<FakeDesktopMediaList> media_list(media_list_); |
| 34 | 34 |
| 35 base::string16 app_name = base::ASCIIToUTF16("foo"); | 35 base::string16 app_name = base::ASCIIToUTF16("foo"); |
| 36 | 36 |
| 37 picker_views_.reset(new DesktopMediaPickerViews()); | 37 picker_views_.reset(new DesktopMediaPickerViews()); |
| 38 picker_views_->Show(NULL, test_helper_.GetContext(), NULL, app_name, | 38 picker_views_->Show(NULL, test_helper_.GetContext(), NULL, app_name, |
| 39 app_name, std::move(media_list), | 39 app_name, std::move(media_list), false, |
| 40 base::Bind(&DesktopMediaPickerViewsTest::OnPickerDone, | 40 base::Bind(&DesktopMediaPickerViewsTest::OnPickerDone, |
| 41 base::Unretained(this))); | 41 base::Unretained(this))); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void TearDown() override { | 44 void TearDown() override { |
| 45 if (GetPickerDialogView()) { | 45 if (GetPickerDialogView()) { |
| 46 EXPECT_CALL(*this, OnPickerDone(content::DesktopMediaID())); | 46 EXPECT_CALL(*this, OnPickerDone(content::DesktopMediaID())); |
| 47 GetPickerDialogView()->GetWidget()->CloseNow(); | 47 GetPickerDialogView()->GetWidget()->CloseNow(); |
| 48 } | 48 } |
| 49 } | 49 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 EXPECT_FALSE( | 215 EXPECT_FALSE( |
| 216 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 216 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 // Verifies that the MediaListView get the initial focus. | 219 // Verifies that the MediaListView get the initial focus. |
| 220 TEST_F(DesktopMediaPickerViewsTest, ListViewHasInitialFocus) { | 220 TEST_F(DesktopMediaPickerViewsTest, ListViewHasInitialFocus) { |
| 221 EXPECT_TRUE(GetPickerDialogView()->GetMediaListViewForTesting()->HasFocus()); | 221 EXPECT_TRUE(GetPickerDialogView()->GetMediaListViewForTesting()->HasFocus()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace views | 224 } // namespace views |
| OLD | NEW |