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

Unified Diff: media/video/capture/screen/screen_capturer_mac_unittest.cc

Issue 12047101: Move screen capturers from remoting/capturer to media/video/capturer/screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/screen/screen_capturer_mac_unittest.cc
diff --git a/remoting/capturer/video_frame_capturer_mac_unittest.cc b/media/video/capture/screen/screen_capturer_mac_unittest.cc
similarity index 74%
rename from remoting/capturer/video_frame_capturer_mac_unittest.cc
rename to media/video/capture/screen/screen_capturer_mac_unittest.cc
index 12435b3e0e506d37f67f6bb130922d7d6a4b9392..a62d40b393607f3b0aaffc352f108b374ccf67c9 100644
--- a/remoting/capturer/video_frame_capturer_mac_unittest.cc
+++ b/media/video/capture/screen/screen_capturer_mac_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/capturer/video_frame_capturer.h"
+#include "media/video/capture/screen/screen_capturer.h"
#include <ApplicationServices/ApplicationServices.h>
@@ -11,14 +11,14 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
-#include "remoting/capturer/capture_data.h"
-#include "remoting/capturer/video_capturer_mock_objects.h"
+#include "media/video/capture/screen/screen_capture_data.h"
+#include "media/video/capture/screen/screen_capturer_mock_objects.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::_;
using ::testing::AnyNumber;
-namespace remoting {
+namespace media {
// Verify that the OS is at least Snow Leopard (10.6).
// Chromoting doesn't support 10.5 or earlier.
@@ -29,18 +29,18 @@ bool CheckSnowLeopard() {
return majorVersion == 10 && minorVersion > 5;
}
-class VideoFrameCapturerMacTest : public testing::Test {
+class ScreenCapturerMacTest : public testing::Test {
public:
// Verifies that the whole screen is initially dirty.
- void CaptureDoneCallback1(scoped_refptr<CaptureData> capture_data);
+ void CaptureDoneCallback1(scoped_refptr<ScreenCaptureData> capture_data);
// Verifies that a rectangle explicitly marked as dirty is propagated
// correctly.
- void CaptureDoneCallback2(scoped_refptr<CaptureData> capture_data);
+ void CaptureDoneCallback2(scoped_refptr<ScreenCaptureData> capture_data);
protected:
virtual void SetUp() OVERRIDE {
- capturer_ = VideoFrameCapturer::Create();
+ capturer_ = ScreenCapturer::Create();
}
void AddDirtyRect() {
@@ -48,13 +48,13 @@ class VideoFrameCapturerMacTest : public testing::Test {
region_.op(rect, SkRegion::kUnion_Op);
}
- scoped_ptr<VideoFrameCapturer> capturer_;
- MockVideoFrameCapturerDelegate delegate_;
+ scoped_ptr<ScreenCapturer> capturer_;
+ MockScreenCapturerDelegate delegate_;
SkRegion region_;
};
-void VideoFrameCapturerMacTest::CaptureDoneCallback1(
- scoped_refptr<CaptureData> capture_data) {
+void ScreenCapturerMacTest::CaptureDoneCallback1(
+ scoped_refptr<ScreenCaptureData> capture_data) {
CGDirectDisplayID mainDevice = CGMainDisplayID();
int width = CGDisplayPixelsWide(mainDevice);
int height = CGDisplayPixelsHigh(mainDevice);
@@ -62,8 +62,8 @@ void VideoFrameCapturerMacTest::CaptureDoneCallback1(
EXPECT_EQ(initial_region, capture_data->dirty_region());
}
-void VideoFrameCapturerMacTest::CaptureDoneCallback2(
- scoped_refptr<CaptureData> capture_data) {
+void ScreenCapturerMacTest::CaptureDoneCallback2(
+ scoped_refptr<ScreenCaptureData> capture_data) {
CGDirectDisplayID mainDevice = CGMainDisplayID();
int width = CGDisplayPixelsWide(mainDevice);
int height = CGDisplayPixelsHigh(mainDevice);
@@ -78,15 +78,15 @@ void VideoFrameCapturerMacTest::CaptureDoneCallback2(
abs(capture_data->stride()));
}
-TEST_F(VideoFrameCapturerMacTest, Capture) {
+TEST_F(ScreenCapturerMacTest, Capture) {
if (!CheckSnowLeopard()) {
return;
}
EXPECT_CALL(delegate_, OnCaptureCompleted(_))
.Times(2)
- .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback1))
- .WillOnce(Invoke(this, &VideoFrameCapturerMacTest::CaptureDoneCallback2));
+ .WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback1))
+ .WillOnce(Invoke(this, &ScreenCapturerMacTest::CaptureDoneCallback2));
EXPECT_CALL(delegate_, OnCursorShapeChangedPtr(_))
.Times(AnyNumber());
@@ -103,7 +103,7 @@ TEST_F(VideoFrameCapturerMacTest, Capture) {
capturer_->Stop();
}
-} // namespace remoting
+} // namespace media
namespace gfx {
« no previous file with comments | « media/video/capture/screen/screen_capturer_mac.mm ('k') | media/video/capture/screen/screen_capturer_mock_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698