| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" | 5 #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "chrome/browser/media/desktop_media_list_observer.h" | 10 #include "chrome/browser/media/desktop_media_list_observer.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 DesktopMediaPicker::DoneCallback callback = | 51 DesktopMediaPicker::DoneCallback callback = |
| 52 base::Bind(&DesktopMediaPickerControllerTest::OnResult, | 52 base::Bind(&DesktopMediaPickerControllerTest::OnResult, |
| 53 base::Unretained(this)); | 53 base::Unretained(this)); |
| 54 | 54 |
| 55 controller_.reset( | 55 controller_.reset( |
| 56 [[DesktopMediaPickerController alloc] | 56 [[DesktopMediaPickerController alloc] |
| 57 initWithMediaList:scoped_ptr<DesktopMediaList>(media_list_) | 57 initWithMediaList:scoped_ptr<DesktopMediaList>(media_list_) |
| 58 parent:nil | 58 parent:nil |
| 59 callback:callback | 59 callback:callback |
| 60 appName:base::ASCIIToUTF16("Screenshare Test")]); | 60 appName:base::ASCIIToUTF16("Screenshare Test") |
| 61 targetName:base::ASCIIToUTF16("Screenshare Test")]); |
| 61 } | 62 } |
| 62 | 63 |
| 63 virtual void TearDown() OVERRIDE { | 64 virtual void TearDown() OVERRIDE { |
| 64 controller_.reset(); | 65 controller_.reset(); |
| 65 CocoaTest::TearDown(); | 66 CocoaTest::TearDown(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 bool WaitForCallback() { | 69 bool WaitForCallback() { |
| 69 if (!callback_called_) { | 70 if (!callback_called_) { |
| 70 base::RunLoop().RunUntilIdle(); | 71 base::RunLoop().RunUntilIdle(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 media_list_->SetSourceName(1, base::ASCIIToUTF16("foo")); | 202 media_list_->SetSourceName(1, base::ASCIIToUTF16("foo")); |
| 202 NSArray* items = [controller_ items]; | 203 NSArray* items = [controller_ items]; |
| 203 EXPECT_NSEQ(@"foo", [[items objectAtIndex:1] imageTitle]); | 204 EXPECT_NSEQ(@"foo", [[items objectAtIndex:1] imageTitle]); |
| 204 | 205 |
| 205 media_list_->MoveSource(1, 0); | 206 media_list_->MoveSource(1, 0); |
| 206 EXPECT_NSEQ(@"foo", [[items objectAtIndex:0] imageTitle]); | 207 EXPECT_NSEQ(@"foo", [[items objectAtIndex:0] imageTitle]); |
| 207 | 208 |
| 208 media_list_->MoveSource(0, 1); | 209 media_list_->MoveSource(0, 1); |
| 209 EXPECT_NSEQ(@"foo", [[items objectAtIndex:1] imageTitle]); | 210 EXPECT_NSEQ(@"foo", [[items objectAtIndex:1] imageTitle]); |
| 210 } | 211 } |
| OLD | NEW |