Commit 35d3dd9b authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

X11 and Ozone: cleanup //content for use_x11 && use_ozone build.

Disables/enables tests for Ozone/Linux or non-Ozone/X11

-----

PS: Please note that this is a temp solution that will help to choose
between ozone and non-ozone X11 build. The switch that will be used
to choose the path is --enable-features=UseOzonePlatform. Once
non-Ozone X11 path is removed (hopefully by Q1 2021 depending on how
th finch trial goes), the wrapper will be removed.

Please also note that it's impossible to build use_x11 && use_ozone
without some hacks in PlatformCursor code. The changes to that are
on their way to upstream.

----

Bug: 1085700
Change-Id: I48797083cecf61929e10381d740590fc4584137d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315027
Commit-Queue: Maksim Sisov (GMT+3) <msisov@igalia.com>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791772}
parent 39f47e3e
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "content/public/test/test_browser_context.h" #include "content/public/test/test_browser_context.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/ui_base_features.h"
#include "url/origin.h" #include "url/origin.h"
using base::test::RunOnceCallback; using base::test::RunOnceCallback;
...@@ -607,10 +608,16 @@ TEST_F(DownloadManagerTest, StartDownload) { ...@@ -607,10 +608,16 @@ TEST_F(DownloadManagerTest, StartDownload) {
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId_(_)) EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId_(_))
.WillOnce(RunOnceCallback<0>(local_id)); .WillOnce(RunOnceCallback<0>(local_id));
#if !defined(USE_X11) // TODO(https://crbug.com/1109690): figure out what to do for Ozone/Linux.
// Doing nothing will set the default download directory to null. // Probably, this can be removed.
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _)); bool should_call_get_save_dir = true;
#if defined(USE_X11)
should_call_get_save_dir = features::IsUsingOzonePlatform();
#endif #endif
if (should_call_get_save_dir) {
// Doing nothing will set the default download directory to null.
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _));
}
EXPECT_CALL(GetMockDownloadManagerDelegate(), EXPECT_CALL(GetMockDownloadManagerDelegate(),
ApplicationClientIdForFileScanning()) ApplicationClientIdForFileScanning())
.WillRepeatedly(Return("client-id")); .WillRepeatedly(Return("client-id"));
...@@ -643,10 +650,16 @@ TEST_F(DownloadManagerTest, StartDownloadWithoutHistoryDB) { ...@@ -643,10 +650,16 @@ TEST_F(DownloadManagerTest, StartDownloadWithoutHistoryDB) {
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId_(_)) EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId_(_))
.WillOnce(RunOnceCallback<0>(download::DownloadItem::kInvalidId)); .WillOnce(RunOnceCallback<0>(download::DownloadItem::kInvalidId));
#if !defined(USE_X11) // TODO(https://crbug.com/1109690): figure out what to do for Ozone/Linux.
// Doing nothing will set the default download directory to null. // Probably, this can be removed.
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _)); bool should_call_get_save_dir = true;
#if defined(USE_X11)
should_call_get_save_dir = features::IsUsingOzonePlatform();
#endif #endif
if (should_call_get_save_dir) {
// Doing nothing will set the default download directory to null.
EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _));
}
EXPECT_CALL(GetMockDownloadManagerDelegate(), EXPECT_CALL(GetMockDownloadManagerDelegate(),
ApplicationClientIdForFileScanning()) ApplicationClientIdForFileScanning())
.WillRepeatedly(Return("client-id")); .WillRepeatedly(Return("client-id"));
......
...@@ -189,6 +189,7 @@ TEST_F(WebContentsViewAuraTest, WebContentsDestroyedDuringClick) { ...@@ -189,6 +189,7 @@ TEST_F(WebContentsViewAuraTest, WebContentsDestroyedDuringClick) {
#if defined(USE_X11) #if defined(USE_X11)
// The web-content is not activated during mouse-press on X11. // The web-content is not activated during mouse-press on X11.
// See comment in WebContentsViewAura::OnMouseEvent() for more details. // See comment in WebContentsViewAura::OnMouseEvent() for more details.
// TODO(https://crbug.com/1109695): enable for Ozone/Linux.
if (!features::IsUsingOzonePlatform()) { if (!features::IsUsingOzonePlatform()) {
EXPECT_NE(web_contents(), nullptr); EXPECT_NE(web_contents(), nullptr);
} else } else
...@@ -317,6 +318,10 @@ TEST_F(WebContentsViewAuraTest, DragDropFiles) { ...@@ -317,6 +318,10 @@ TEST_F(WebContentsViewAuraTest, DragDropFiles) {
#if defined(OS_WIN) || defined(USE_X11) #if defined(OS_WIN) || defined(USE_X11)
TEST_F(WebContentsViewAuraTest, DragDropFilesOriginateFromRenderer) { TEST_F(WebContentsViewAuraTest, DragDropFilesOriginateFromRenderer) {
#if defined(USE_X11)
if (features::IsUsingOzonePlatform())
return;
#endif
WebContentsViewAura* view = GetView(); WebContentsViewAura* view = GetView();
auto data = std::make_unique<ui::OSExchangeData>(); auto data = std::make_unique<ui::OSExchangeData>();
......
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