Skip to content

Commit

Permalink
Revert of Move DefaultActivationClient to wm/core (https://codereview…
Browse files Browse the repository at this point in the history
….chromium.org/250113002/)

Reason for revert:
views_unittest TooltipController test failures
views_unittests views_unittests 4 disabled 10 flaky failed 10 ( 9 secs )
stdio
Capture
CloseOnCaptureLost
DontShowEmptyTooltips
EnableOrDisableTooltips
HideOnExit
ReshowOnClickAfterEnterExit
TooltipHidesOnKeyPressAndStaysHiddenUntilChange
TooltipHidesOnTimeoutAndStaysHiddenUntilChange
TooltipsInMultipleViews
ViewTooltip


TooltipControllerTest.ViewTooltip (run chromium#2):
[ RUN      ] TooltipControllerTest.ViewTooltip
Xlib:  extension "RANDR" missing on display ":9".
Received signal 11 SEGV_MAPERR 000000000000
#0 0x000000a88e4e base::debug::StackTrace::StackTrace()
chromium#1 0x000000a89068 base::debug::(anonymous namespace)::StackDumpSignalHandler()
chromium#2 0x7f9474270cb0 \u003Cunknown>
chromium#3 0x000000736b83 views::NativeWidgetAura::Activate()
chromium#4 0x000000737508 views::NativeWidgetAura::ShowWithWindowState()
chromium#5 0x000000738acb views::Widget::Show()
chromium#6 0x00000052cb09 views::corewm::test::(anonymous namespace)::CreateWidget()
chromium#7 0x00000052d397 views::corewm::test::TooltipControllerTest::SetUp()
chromium#8 0x00000065a16a testing::Test::Run().

Original issue's description:
> Move DefaultActivationClient to wm/core
> 
> Several tests are using AuraTestHelper and were relying on it to set up the DefaultActivationClient, so I had to have them instantiate the DAC directly after calling SetUp() on the helper. I also had to make the DAC delete itself after the root window it's bound to is destroyed.
> 
> R=sky@chromium.org
> http://crbug.com/308710
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266616
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266975

TBR=sky@chromium.org,ben@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/261553002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267001 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
robliao@chromium.org committed Apr 30, 2014
1 parent aafcd5e commit 7c44a3a
Show file tree
Hide file tree
Showing 32 changed files with 121 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "ui/aura/test/aura_test_helper.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/wm/core/default_activation_client.h"
#endif

using base::ASCIIToUTF16;
Expand Down Expand Up @@ -114,7 +113,6 @@ class AccessibilityEventRouterViewsTest

aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());
#endif // USE_AURA
EnableAccessibilityAndListenToFocusNotifications();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/wm/core/default_activation_client.h"
#include "ui/wm/core/easy_resize_window_targeter.h"

class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
Expand All @@ -29,7 +28,6 @@ class ShapedAppWindowTargeterTest : public aura::test::AuraTestBase {
protected:
virtual void SetUp() OVERRIDE {
aura::test::AuraTestBase::SetUp();
new wm::DefaultActivationClient(root_window());
widget_.reset(new views::Widget);
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
params.remove_standard_frame = true;
Expand Down
2 changes: 0 additions & 2 deletions chrome/test/base/browser_with_test_window_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#if defined(USE_AURA)
#include "ui/aura/test/aura_test_helper.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/wm/core/default_activation_client.h"
#endif

#if defined(USE_ASH)
Expand Down Expand Up @@ -71,7 +70,6 @@ void BrowserWithTestWindowTest::SetUp() {
aura_test_helper_.reset(new aura::test::AuraTestHelper(
base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());
#endif // USE_AURA
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset(CreateViewsDelegate());
Expand Down
2 changes: 0 additions & 2 deletions chrome/test/base/view_event_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "ui/message_center/message_center.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/core/default_activation_client.h"
#include "ui/wm/core/wm_state.h"

#if defined(USE_ASH)
Expand Down Expand Up @@ -141,7 +140,6 @@ void ViewEventTestBase::SetUp() {
aura_test_helper_.reset(
new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());
context = aura_test_helper_->root_window();
#endif // !USE_ASH && USE_AURA

Expand Down
2 changes: 1 addition & 1 deletion content/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ include_rules = [
"+ui/shell_dialogs",
"+ui/snapshot",
"+ui/surface",
"+ui/wm",
"+ui/wm/public",
# Content knows about grd files, but the specifics of how to get a resource
# given its id is left to the embedder.
"-ui/base/l10n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/window.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/wm/core/default_activation_client.h"

using ::testing::_;
using ::testing::AnyNumber;
Expand Down Expand Up @@ -66,7 +65,6 @@ class DesktopCaptureDeviceAuraTest : public testing::Test {
ui::InitializeContextFactoryForTests(enable_pixel_output);
helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
helper_->SetUp();
new wm::DefaultActivationClient(helper_->root_window());

// We need a window to cover desktop area so that DesktopCaptureDeviceAura
// can use gfx::NativeWindow::GetWindowAtScreenPoint() to locate the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "ui/compositor/test/in_process_context_factory.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/wm/core/default_activation_client.h"

using testing::_;

Expand Down Expand Up @@ -208,7 +207,6 @@ class RenderWidgetHostViewAuraTest : public testing::Test {
scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory));
aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_));
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());

browser_context_.reset(new TestBrowserContext);
process_host_ = new MockRenderProcessHost(browser_context_.get());
Expand Down
2 changes: 0 additions & 2 deletions content/content_tests.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
'dependencies': [
'../ui/aura/aura.gyp:aura_test_support',
'../ui/resources/ui_resources.gyp:ui_test_pak',
'../ui/wm/wm.gyp:wm',
],
}],
['use_aura==1 or OS=="mac"', {
Expand Down Expand Up @@ -860,7 +859,6 @@
['use_aura==1', {
'dependencies': [
'../ui/aura/aura.gyp:aura',
'../ui/wm/wm.gyp:wm',
]
}],
['use_aura==1 or toolkit_views==1', {
Expand Down
2 changes: 0 additions & 2 deletions content/public/test/test_renderer_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#if defined(USE_AURA)
#include "ui/aura/test/aura_test_helper.h"
#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/wm/core/default_activation_client.h"
#endif

namespace content {
Expand Down Expand Up @@ -175,7 +174,6 @@ void RenderViewHostTestHarness::SetUp() {
aura_test_helper_.reset(
new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
new wm::DefaultActivationClient(aura_test_helper_->root_window());
#endif

DCHECK(!browser_context_);
Expand Down
5 changes: 3 additions & 2 deletions content/shell/browser/shell_platform_data_aura.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "content/shell/browser/shell.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/default_activation_client.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/env.h"
#include "ui/aura/layout_manager.h"
Expand All @@ -17,7 +18,6 @@
#include "ui/base/ime/input_method_delegate.h"
#include "ui/base/ime/input_method_factory.h"
#include "ui/gfx/screen.h"
#include "ui/wm/core/default_activation_client.h"

namespace content {

Expand Down Expand Up @@ -121,7 +121,8 @@ ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) {
focus_client_.reset(new aura::test::TestFocusClient());
aura::client::SetFocusClient(host_->window(), focus_client_.get());

new wm::DefaultActivationClient(host_->window());
activation_client_.reset(
new aura::client::DefaultActivationClient(host_->window()));
capture_client_.reset(
new aura::client::DefaultCaptureClient(host_->window()));
window_tree_client_.reset(
Expand Down
2 changes: 2 additions & 0 deletions content/shell/browser/shell_platform_data_aura.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace aura {
namespace client {
class DefaultActivationClient;
class DefaultCaptureClient;
class FocusClient;
class WindowTreeClient;
Expand Down Expand Up @@ -39,6 +40,7 @@ class ShellPlatformDataAura {
private:
scoped_ptr<aura::WindowTreeHost> host_;
scoped_ptr<aura::client::FocusClient> focus_client_;
scoped_ptr<aura::client::DefaultActivationClient> activation_client_;
scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
scoped_ptr<aura::client::WindowTreeClient> window_tree_client_;
scoped_ptr<ui::EventHandler> ime_filter_;
Expand Down
1 change: 0 additions & 1 deletion mojo/examples/launcher/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ include_rules = [
"+ui/gfx",
"+ui/gl",
"+ui/views",
"+ui/wm",
"+webkit/common/gpu",
]
6 changes: 4 additions & 2 deletions mojo/examples/launcher/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "mojo/public/interfaces/shell/shell.mojom.h"
#include "mojo/services/native_viewport/native_viewport.mojom.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/default_activation_client.h"
#include "ui/aura/client/default_capture_client.h"
#include "ui/aura/client/window_tree_client.h"
#include "ui/aura/env.h"
Expand All @@ -44,7 +45,6 @@
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/core/default_activation_client.h"
#include "url/gurl.h"

#if defined(WIN32)
Expand Down Expand Up @@ -244,7 +244,8 @@ class LauncherImpl : public Application,
focus_client_.reset(new aura::test::TestFocusClient());
aura::client::SetFocusClient(window_tree_host_->window(),
focus_client_.get());
new wm::DefaultActivationClient(window_tree_host_->window());
activation_client_.reset(
new aura::client::DefaultActivationClient(window_tree_host_->window()));
capture_client_.reset(
new aura::client::DefaultCaptureClient(window_tree_host_->window()));
ime_filter_.reset(new MinimalInputEventFilter(window_tree_host_->window()));
Expand All @@ -262,6 +263,7 @@ class LauncherImpl : public Application,

scoped_ptr<DemoScreen> screen_;
scoped_ptr<LauncherWindowTreeClient> window_tree_client_;
scoped_ptr<aura::client::DefaultActivationClient> activation_client_;
scoped_ptr<aura::client::FocusClient> focus_client_;
scoped_ptr<aura::client::DefaultCaptureClient> capture_client_;
scoped_ptr<ui::EventHandler> ime_filter_;
Expand Down
1 change: 0 additions & 1 deletion mojo/mojo_examples.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/views/views.gyp:views',
'../ui/wm/wm.gyp:wm',
'../url/url.gyp:url_lib',
'mojo_aura_demo_support',
'mojo_common_lib',
Expand Down
2 changes: 2 additions & 0 deletions ui/aura/aura.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
'client/cursor_client.h',
'client/cursor_client_observer.h',
'client/cursor_client_observer.cc',
'client/default_activation_client.cc',
'client/default_activation_client.h',
'client/default_capture_client.cc',
'client/default_capture_client.h',
'client/event_client.cc',
Expand Down
Loading

0 comments on commit 7c44a3a

Please sign in to comment.