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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/media/fake_desktop_media_list.h" | 8 #include "chrome/browser/media/fake_desktop_media_list.h" |
9 #include "chrome/browser/ui/views/desktop_media_picker_views.h" | 9 #include "chrome/browser/ui/views/desktop_media_picker_views.h" |
10 #include "components/web_modal/test_web_contents_modal_dialog_host.h" | 10 #include "components/web_modal/test_web_contents_modal_dialog_host.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 scoped_ptr<FakeDesktopMediaList> media_list(media_list_); | 43 scoped_ptr<FakeDesktopMediaList> media_list(media_list_); |
44 | 44 |
45 base::string16 app_name = base::ASCIIToUTF16("foo"); | 45 base::string16 app_name = base::ASCIIToUTF16("foo"); |
46 | 46 |
47 picker_views_.reset(new DesktopMediaPickerViews()); | 47 picker_views_.reset(new DesktopMediaPickerViews()); |
48 picker_views_->Show(NULL, | 48 picker_views_->Show(NULL, |
49 parent_widget_->GetNativeWindow(), | 49 parent_widget_->GetNativeWindow(), |
50 NULL, | 50 NULL, |
51 app_name, | 51 app_name, |
52 app_name, | 52 app_name, |
53 media_list.PassAs<DesktopMediaList>(), | 53 media_list.Pass(), |
54 base::Bind(&DesktopMediaPickerViewsTest::OnPickerDone, | 54 base::Bind(&DesktopMediaPickerViewsTest::OnPickerDone, |
55 base::Unretained(this))); | 55 base::Unretained(this))); |
56 } | 56 } |
57 | 57 |
58 virtual void TearDown() override { | 58 virtual void TearDown() override { |
59 test_helper_->TearDown(); | 59 test_helper_->TearDown(); |
60 ui::TerminateContextFactoryForTests(); | 60 ui::TerminateContextFactoryForTests(); |
61 } | 61 } |
62 | 62 |
63 DesktopMediaPickerDialogView* GetPickerDialogView() const { | 63 DesktopMediaPickerDialogView* GetPickerDialogView() const { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus(); | 193 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus(); |
194 EXPECT_TRUE( | 194 EXPECT_TRUE( |
195 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 195 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
196 | 196 |
197 media_list_->RemoveSource(0); | 197 media_list_->RemoveSource(0); |
198 EXPECT_FALSE( | 198 EXPECT_FALSE( |
199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
200 } | 200 } |
201 | 201 |
202 } // namespace views | 202 } // namespace views |
OLD | NEW |