OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // A dummy implementation of gfx::Screen, since WebContentsVideoCaptureDevice | 465 // A dummy implementation of gfx::Screen, since WebContentsVideoCaptureDevice |
466 // needs access to a gfx::Display's device scale factor. | 466 // needs access to a gfx::Display's device scale factor. |
467 class FakeScreen : public gfx::Screen { | 467 class FakeScreen : public gfx::Screen { |
468 public: | 468 public: |
469 FakeScreen() : the_one_display_(0x1337, gfx::Rect(0, 0, 2560, 1440)) { | 469 FakeScreen() : the_one_display_(0x1337, gfx::Rect(0, 0, 2560, 1440)) { |
470 the_one_display_.set_device_scale_factor(kTestDeviceScaleFactor); | 470 the_one_display_.set_device_scale_factor(kTestDeviceScaleFactor); |
471 } | 471 } |
472 ~FakeScreen() override {} | 472 ~FakeScreen() override {} |
473 | 473 |
474 // gfx::Screen implementation (only what's needed for testing). | 474 // gfx::Screen implementation (only what's needed for testing). |
475 bool IsDIPEnabled() override { return true; } | |
476 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } | 475 gfx::Point GetCursorScreenPoint() override { return gfx::Point(); } |
477 gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } | 476 gfx::NativeWindow GetWindowUnderCursor() override { return NULL; } |
478 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { | 477 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { |
479 return NULL; | 478 return NULL; |
480 } | 479 } |
481 int GetNumDisplays() const override { return 1; } | 480 int GetNumDisplays() const override { return 1; } |
482 std::vector<gfx::Display> GetAllDisplays() const override { | 481 std::vector<gfx::Display> GetAllDisplays() const override { |
483 return std::vector<gfx::Display>(1, the_one_display_); | 482 return std::vector<gfx::Display>(1, the_one_display_); |
484 } | 483 } |
485 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override { | 484 gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override { |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 source()->SetSolidColor(SK_ColorGREEN); | 843 source()->SetSolidColor(SK_ColorGREEN); |
845 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 844 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
846 source()->SetSolidColor(SK_ColorRED); | 845 source()->SetSolidColor(SK_ColorRED); |
847 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); | 846 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorRED)); |
848 | 847 |
849 device()->StopAndDeAllocate(); | 848 device()->StopAndDeAllocate(); |
850 } | 849 } |
851 | 850 |
852 } // namespace | 851 } // namespace |
853 } // namespace content | 852 } // namespace content |
OLD | NEW |