Commit 37618e14 authored by Clifford Cheng's avatar Clifford Cheng Committed by Commit Bot

Reland "Enable the pixel by pixel comparison test for Mac OS."

This is a reland of 01ccf727

Original change's description:
> Enable the pixel by pixel comparison test for Mac OS.
> 
> 1. Tested on Mac and verify everything works as expected.
> 2. Removed the unnecessary call of GetNativeWindow().
> 
> Change-Id: I377e6bfb004548887b9623b0094da91fa36b4d1c
> Reviewed-on: https://chromium-review.googlesource.com/c/1279301
> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
> Commit-Queue: Clifford Cheng <cliffordcheng@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#601879}

Change-Id: Ib6fa1c1d9b3487c88b240ea9262042db8af0c19a
Reviewed-on: https://chromium-review.googlesource.com/c/1296811Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Clifford Cheng <cliffordcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603544}
parent 8b5fda70
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/overlay/overlay_window_views.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_request.h"
...@@ -190,7 +189,7 @@ IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest, ...@@ -190,7 +189,7 @@ IN_PROC_BROWSER_TEST_F(PictureInPictureWindowControllerBrowserTest,
EXPECT_TRUE(window_controller()->GetWindowForTesting()->IsVisible()); EXPECT_TRUE(window_controller()->GetWindowForTesting()->IsVisible());
} }
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) #if (defined(OS_MACOSX) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
class PictureInPicturePixelComparisonBrowserTest class PictureInPicturePixelComparisonBrowserTest
: public PictureInPictureWindowControllerBrowserTest { : public PictureInPictureWindowControllerBrowserTest {
public: public:
...@@ -233,8 +232,7 @@ class PictureInPicturePixelComparisonBrowserTest ...@@ -233,8 +232,7 @@ class PictureInPicturePixelComparisonBrowserTest
base::BindOnce( base::BindOnce(
&PictureInPicturePixelComparisonBrowserTest::ReadbackResult, &PictureInPicturePixelComparisonBrowserTest::ReadbackResult,
base::Unretained(this), run_loop.QuitClosure())); base::Unretained(this), run_loop.QuitClosure()));
overlay_window_views->GetNativeWindow()->layer()->RequestCopyOfOutput( overlay_window_views->GetLayer()->RequestCopyOfOutput(std::move(request));
std::move(request));
run_loop.Run(); run_loop.Run();
} }
...@@ -271,8 +269,7 @@ class PictureInPicturePixelComparisonBrowserTest ...@@ -271,8 +269,7 @@ class PictureInPicturePixelComparisonBrowserTest
std::unique_ptr<SkBitmap> result_bitmap_; std::unique_ptr<SkBitmap> result_bitmap_;
}; };
// TODO(cliffordcheng): enable this tests on other platforms when // TODO(cliffordcheng): enable on Windows when compile errors are resolved.
// Windows and Mac capture screen problem is solved.
// Plays a video and then trigger Picture-in-Picture. Grabs a screenshot of // Plays a video and then trigger Picture-in-Picture. Grabs a screenshot of
// Picture-in-Picture window and verifies it's as expected. // Picture-in-Picture window and verifies it's as expected.
IN_PROC_BROWSER_TEST_F(PictureInPicturePixelComparisonBrowserTest, VideoPlay) { IN_PROC_BROWSER_TEST_F(PictureInPicturePixelComparisonBrowserTest, VideoPlay) {
...@@ -320,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(PictureInPicturePixelComparisonBrowserTest, VideoPlay) { ...@@ -320,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(PictureInPicturePixelComparisonBrowserTest, VideoPlay) {
ASSERT_TRUE(SaveBitmap(test_image_path, GetResultBitmap())); ASSERT_TRUE(SaveBitmap(test_image_path, GetResultBitmap()));
EXPECT_TRUE(CompareImages(GetResultBitmap())); EXPECT_TRUE(CompareImages(GetResultBitmap()));
} }
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) #endif // (defined(OS_MACOSX) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
// Tests that when an active WebContents accurately tracks whether a video // Tests that when an active WebContents accurately tracks whether a video
// is in Picture-in-Picture. // is in Picture-in-Picture.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment