Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/ui/views/desktop_media_picker_views_unittest.cc

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698