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

Unified Diff: remoting/host/shaped_screen_capturer_unittest.cc

Issue 455073004: Switch DesktopEnvironment to return a DesktopCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ShapedDesktopCapturer::Create() Created 6 years, 4 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
« no previous file with comments | « remoting/host/shaped_screen_capturer.cc ('k') | remoting/host/video_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/shaped_screen_capturer_unittest.cc
diff --git a/remoting/host/shaped_screen_capturer_unittest.cc b/remoting/host/shaped_screen_capturer_unittest.cc
deleted file mode 100644
index 1be21bf0d3cdc64501019661eadbc5f2cef422c1..0000000000000000000000000000000000000000
--- a/remoting/host/shaped_screen_capturer_unittest.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "remoting/host/shaped_screen_capturer.h"
-
-#include "remoting/host/desktop_shape_tracker.h"
-#include "remoting/host/fake_screen_capturer.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
-#include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
-
-namespace remoting {
-
-class FakeDesktopShapeTracker : public DesktopShapeTracker {
- public:
- FakeDesktopShapeTracker() {}
- virtual ~FakeDesktopShapeTracker() {}
-
- static webrtc::DesktopRegion CreateShape() {
- webrtc::DesktopRegion result;
- result.AddRect(webrtc::DesktopRect::MakeXYWH(0, 0, 5, 5));
- result.AddRect(webrtc::DesktopRect::MakeXYWH(5, 5, 5, 5));
- return result;
- }
-
- virtual void RefreshDesktopShape() OVERRIDE {
- shape_ = CreateShape();
- }
-
- virtual const webrtc::DesktopRegion& desktop_shape() OVERRIDE {
- // desktop_shape() can't be called before RefreshDesktopShape().
- EXPECT_FALSE(shape_.is_empty());
- return shape_;
- }
-
- private:
- webrtc::DesktopRegion shape_;
-};
-
-class ShapedScreenCapturerTest : public testing::Test,
- public webrtc::DesktopCapturer::Callback {
- public:
- // webrtc::DesktopCapturer::Callback interface
- virtual webrtc::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE {
- return NULL;
- }
-
- virtual void OnCaptureCompleted(webrtc::DesktopFrame* frame) OVERRIDE {
- last_frame_.reset(frame);
- }
-
- scoped_ptr<webrtc::DesktopFrame> last_frame_;
-};
-
-// Verify that captured frame have shape.
-TEST_F(ShapedScreenCapturerTest, Basic) {
- ShapedScreenCapturer capturer(
- scoped_ptr<webrtc::ScreenCapturer>(new FakeScreenCapturer()),
- scoped_ptr<DesktopShapeTracker>(new FakeDesktopShapeTracker()));
- capturer.Start(this);
- capturer.Capture(webrtc::DesktopRegion());
- ASSERT_TRUE(last_frame_.get());
- ASSERT_TRUE(last_frame_->shape());
- EXPECT_TRUE(
- FakeDesktopShapeTracker::CreateShape().Equals(*last_frame_->shape()));
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/host/shaped_screen_capturer.cc ('k') | remoting/host/video_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698