Commit b6160c86 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

Revert "Ignore window [de]activation in content_browsertests."

This reverts commit 901d5088.

Reason for revert: Didn't address concerns of where this API should live. In particular DNWA isn't the right place, it should be on Widget.

Original change's description:
> Ignore window [de]activation in content_browsertests.
> 
> These events can happen when another test starts or finishes and cause
> frame/widget focus state changes, breaking some tests.
> 
> Bug: 695054
> Change-Id: I9ab6b3887c00421d4c6f96dd508e912b23706176
> Reviewed-on: https://chromium-review.googlesource.com/926368
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Commit-Queue: Alexander Semashko <ahest@yandex-team.ru>
> Cr-Commit-Position: refs/heads/master@{#543328}

TBR=sky@chromium.org,dcheng@chromium.org,jam@chromium.org,dpranke@chromium.org,ahest@yandex-team.ru

Change-Id: Ia3b8b9eabb4463ddcd22e81cec1f5ee7fffa639e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 695054
Reviewed-on: https://chromium-review.googlesource.com/963658Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543378}
parent fa9989eb
...@@ -23,7 +23,4 @@ specific_include_rules = { ...@@ -23,7 +23,4 @@ specific_include_rules = {
"+third_party/iaccessible2", "+third_party/iaccessible2",
"+ui/base/resource/resource_bundle.h", "+ui/base/resource/resource_bundle.h",
], ],
"content_browser_test.cc": [
"+ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
],
} }
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
#include "ui/base/ime/input_method_initializer.h" #include "ui/base/ime/input_method_initializer.h"
#endif #endif
#if defined(USE_AURA)
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" // nogncheck
#endif
namespace content { namespace content {
ContentBrowserTest::ContentBrowserTest() { ContentBrowserTest::ContentBrowserTest() {
...@@ -85,13 +81,6 @@ void ContentBrowserTest::SetUp() { ...@@ -85,13 +81,6 @@ void ContentBrowserTest::SetUp() {
subprocess_path); subprocess_path);
#endif #endif
#if defined(USE_AURA)
// https://crbug.com/695054: Ignore window activation/deactivation to make
// the Chrome-internal focus unaffected by OS events caused by running tests
// in parallel.
views::DesktopNativeWidgetAura::DisableActivationChangeHandlingForTests();
#endif
// LinuxInputMethodContextFactory has to be initialized. // LinuxInputMethodContextFactory has to be initialized.
#if !defined(OS_CHROMEOS) && defined(OS_LINUX) #if !defined(OS_CHROMEOS) && defined(OS_LINUX)
ui::InitializeInputMethodForTesting(); ui::InitializeInputMethodForTesting();
......
...@@ -538,10 +538,6 @@ jumbo_static_library("browsertest_support") { ...@@ -538,10 +538,6 @@ jumbo_static_library("browsertest_support") {
deps += [ "//content/public/browser" ] deps += [ "//content/public/browser" ]
} }
if (use_aura) {
deps += [ "//ui/views" ]
}
configs += [ "//v8:external_startup_data" ] configs += [ "//v8:external_startup_data" ]
} }
......
...@@ -72,8 +72,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(DesktopNativeWidgetAura*, ...@@ -72,8 +72,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(DesktopNativeWidgetAura*,
namespace { namespace {
bool g_disable_activation_change_handling_ = false;
// This class provides functionality to create a top level widget to host a // This class provides functionality to create a top level widget to host a
// child window. // child window.
class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver { class DesktopNativeWidgetTopLevelHandler : public aura::WindowObserver {
...@@ -238,11 +236,6 @@ DesktopNativeCursorManager* DesktopNativeWidgetAura::native_cursor_manager_ = ...@@ -238,11 +236,6 @@ DesktopNativeCursorManager* DesktopNativeWidgetAura::native_cursor_manager_ =
NULL; NULL;
wm::CursorManager* DesktopNativeWidgetAura::cursor_manager_ = NULL; wm::CursorManager* DesktopNativeWidgetAura::cursor_manager_ = NULL;
// static
void DesktopNativeWidgetAura::DisableActivationChangeHandlingForTests() {
g_disable_activation_change_handling_ = true;
}
DesktopNativeWidgetAura::DesktopNativeWidgetAura( DesktopNativeWidgetAura::DesktopNativeWidgetAura(
internal::NativeWidgetDelegate* delegate) internal::NativeWidgetDelegate* delegate)
: desktop_window_tree_host_(NULL), : desktop_window_tree_host_(NULL),
...@@ -355,9 +348,6 @@ void DesktopNativeWidgetAura::OnDesktopWindowTreeHostDestroyed( ...@@ -355,9 +348,6 @@ void DesktopNativeWidgetAura::OnDesktopWindowTreeHostDestroyed(
} }
void DesktopNativeWidgetAura::HandleActivationChanged(bool active) { void DesktopNativeWidgetAura::HandleActivationChanged(bool active) {
if (g_disable_activation_change_handling_)
return;
native_widget_delegate_->OnNativeWidgetActivationChanged(active); native_widget_delegate_->OnNativeWidgetActivationChanged(active);
wm::ActivationClient* activation_client = wm::ActivationClient* activation_client =
wm::GetActivationClient(host_->window()); wm::GetActivationClient(host_->window());
......
...@@ -100,10 +100,6 @@ class VIEWS_EXPORT DesktopNativeWidgetAura ...@@ -100,10 +100,6 @@ class VIEWS_EXPORT DesktopNativeWidgetAura
// Overridden from internal::NativeWidgetPrivate: // Overridden from internal::NativeWidgetPrivate:
gfx::NativeWindow GetNativeWindow() const override; gfx::NativeWindow GetNativeWindow() const override;
// Forces HandleActivationChanged to do nothing, making Chrome-internal notion
// of focused and active windows independent from the OS.
static void DisableActivationChangeHandlingForTests();
protected: protected:
// Overridden from internal::NativeWidgetPrivate: // Overridden from internal::NativeWidgetPrivate:
void InitNativeWidget(const Widget::InitParams& params) override; void InitNativeWidget(const Widget::InitParams& params) override;
......
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