Revert "Remove views::test::IsOzoneBubblesUsingPlatformWidgets()"

This reverts commit 60646016c6fcb6c296cbec1fbe9c80fe7fe39155.

Reason for revert: talking to the original author of the 
kOzoneBubblesUsePlatformWidgets feature (fangzhoug@), it was 
mentioned that the feature might still be useful to other platforms, 
eg linux, with some work.
This CL, then, reverts the original removal.

In a follow up CL, the lacros checks will be removed instead.

Original change's description:
> Remove views::test::IsOzoneBubblesUsingPlatformWidgets()
>
> This CL removes the aforementioned method and its respective calls
> sides.
> Today it always returns FALSE as it bool-checks whether
> `features::kOzoneBubblesUsePlatformWidgets` is enabled, something that
> only happens in Lacros builds.
> Now that Lacros project is terminated, the method became no-op.
>
> In a follow up I will coordinate with kramer (fangzhoug@) the removal of
> the feature flag+impl.
>
> R=hidehiko@chromium.org, neis@chromium.org
>
> Bug: 375937556, 374244479, 373971535
> Change-Id: Ia9aea5ef8a469f197dd4f8661f46ee223cc748a5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5973705
> Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Reviewed-by: Peter Boström <pbos@chromium.org>
> Auto-Submit: Antonio Gomes <tonikitoo@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#1376017}

Bug: 375937556, 374244479, 373971535
Change-Id: I5b7af7df319041c6a68b89c41204db5e70407d8f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5979515
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Peter Boström <pbos@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1376793}
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
index d6e677a..74c0482 100644
--- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
+++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_chromeos_browsertest.cc
@@ -1359,9 +1359,21 @@
   ASSERT_TRUE(base::test::RunUntil(
       [&]() { return size_button->IsMultitaskMenuShown(); }));
 
-  // Pressing accelerator a second time should close the menu.
-  event_generator.PressAndReleaseKeyAndModifierKeys(ui::VKEY_Z,
-                                                    ui::EF_COMMAND_DOWN);
+  // With platform bubble, key event is routed to the platform bubble at ozone
+  // level, so dispatch it to the multitask_menu_widget directly.
+  if (views::test::IsOzoneBubblesUsingPlatformWidgets()) {
+    ui::test::EventGenerator multitask_view_event_generator(
+        size_button->multitask_menu_widget_for_testing()
+            ->GetNativeWindow()
+            ->GetRootWindow());
+    // Pressing accelerator a second time should close the menu.
+    multitask_view_event_generator.PressAndReleaseKeyAndModifierKeys(
+        ui::VKEY_Z, ui::EF_COMMAND_DOWN);
+  } else {
+    // Pressing accelerator a second time should close the menu.
+    event_generator.PressAndReleaseKeyAndModifierKeys(ui::VKEY_Z,
+                                                      ui::EF_COMMAND_DOWN);
+  }
 
   ASSERT_TRUE(base::test::RunUntil(
       [&]() { return !size_button->IsMultitaskMenuShown(); }));
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_view_views_browsertest.cc
index ce889fa..e3c8c0d 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_view_views_browsertest.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_view_views_browsertest.cc
@@ -270,6 +270,12 @@
 #endif
 // Test that clicks over the omnibox do not hit the popup.
 IN_PROC_BROWSER_TEST_F(OmniboxPopupViewViewsTest, MAYBE_ClickOmnibox) {
+  // TODO(https://crbug.com/329235190): Should be an interactive_ui_test if
+  // omnibox popup is an accelerated widget.
+  if (views::test::IsOzoneBubblesUsingPlatformWidgets()) {
+    GTEST_SKIP();
+  }
+
   CreatePopupForTestQuery();
 
   gfx::NativeWindow event_window = browser()->window()->GetNativeWindow();
diff --git a/chrome/browser/ui/views/translate/translate_icon_view_interactive_uitest.cc b/chrome/browser/ui/views/translate/translate_icon_view_interactive_uitest.cc
index dcf087e..55faa95 100644
--- a/chrome/browser/ui/views/translate/translate_icon_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/translate/translate_icon_view_interactive_uitest.cc
@@ -51,6 +51,15 @@
     views::Widget::InitParams params(ownership,
                                      views::Widget::InitParams::TYPE_WINDOW);
     widget->Init(std::move(params));
+    // TODO(https://crbug.com/329235190): The bubble child of a widget that is
+    // invisible will not be mapped through wayland and hence never shown so
+    // widget must be shown. However, showing widget causes
+    // RunAccessibilityPaintChecks() to fail when this feature is disabled due
+    // to node_data.GetNameFrom() == kContents.
+    if (views::test::IsOzoneBubblesUsingPlatformWidgets()) {
+      widget->Show();
+    }
+
     return widget;
   }
 };
diff --git a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
index 46f9714..48d9aba 100644
--- a/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
+++ b/chrome/browser/ui/views/web_apps/frame_toolbar/web_app_frame_toolbar_browsertest.cc
@@ -1368,6 +1368,16 @@
 // Regression test for https://crbug.com/1448878.
 IN_PROC_BROWSER_TEST_F(WebAppFrameToolbarBrowserTest_WindowControlsOverlay,
                        DraggableRegionsIgnoredForOwnedWidgets) {
+  // TODO(https://crbug.com/329235190): Lacros using accelerated widget for
+  // bubble, so the point within browser_view is still draggable and returns
+  // `HTCAPTION`.
+  //
+  // TODO(https://crbug.com/375937556): Revise this now that Lacros support is
+  // removed.
+  if (views::test::IsOzoneBubblesUsingPlatformWidgets()) {
+    GTEST_SKIP();
+  }
+
   auto app_id = InstallAndLaunchFullyDraggableWebApp();
   ToggleWindowControlsOverlayAndWait();
 
diff --git a/ui/views/test/views_test_utils.cc b/ui/views/test/views_test_utils.cc
index cc532770..eb8ca9f01 100644
--- a/ui/views/test/views_test_utils.cc
+++ b/ui/views/test/views_test_utils.cc
@@ -33,4 +33,16 @@
     parent_view->DeprecatedLayoutImmediately();
 }
 
+bool IsOzoneBubblesUsingPlatformWidgets() {
+#if BUILDFLAG(IS_OZONE)
+  return base::FeatureList::IsEnabled(
+             features::kOzoneBubblesUsePlatformWidgets) &&
+         ui::OzonePlatform::GetInstance()
+             ->GetPlatformRuntimeProperties()
+             .supports_subwindows_as_accelerated_widgets;
+#else
+  return false;
+#endif
+}
+
 }  // namespace views::test
diff --git a/ui/views/test/views_test_utils.h b/ui/views/test/views_test_utils.h
index 7f71cca..8b30941 100644
--- a/ui/views/test/views_test_utils.h
+++ b/ui/views/test/views_test_utils.h
@@ -21,6 +21,10 @@
 // root parent view.
 void RunScheduledLayout(View* view);
 
+// Certain tests will fail when this experiment is running.
+// TODO(crbug.com/329235190): Re-enable these tests and remove this function.
+bool IsOzoneBubblesUsingPlatformWidgets();
+
 }  // namespace test
 }  // namespace views