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 28 matching lines...) Expand all Loading... |
39 parent_widget_.reset(new Widget); | 39 parent_widget_.reset(new Widget); |
40 parent_widget_->Init(params); | 40 parent_widget_->Init(params); |
41 | 41 |
42 media_list_ = new FakeDesktopMediaList(); | 42 media_list_ = new FakeDesktopMediaList(); |
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 NULL, | 50 NULL, |
50 parent_widget_->GetNativeWindow(), | |
51 app_name, | 51 app_name, |
52 app_name, | 52 app_name, |
53 media_list.PassAs<DesktopMediaList>(), | 53 media_list.PassAs<DesktopMediaList>(), |
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(); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus(); | 197 GetPickerDialogView()->GetMediaSourceViewForTesting(0)->OnFocus(); |
198 EXPECT_TRUE( | 198 EXPECT_TRUE( |
199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 199 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
200 | 200 |
201 media_list_->RemoveSource(0); | 201 media_list_->RemoveSource(0); |
202 EXPECT_FALSE( | 202 EXPECT_FALSE( |
203 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 203 GetPickerDialogView()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
204 } | 204 } |
205 | 205 |
206 } // namespace views | 206 } // namespace views |
OLD | NEW |