Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Unified Diff: ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc

Issue 193593002: Revert 256067 "Merge 255714 "Fixes bug that resulted in status b..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_focus_rules.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc
===================================================================
--- ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc (revision 256070)
+++ ui/views/widget/desktop_aura/desktop_focus_rules_unittest.cc (working copy)
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/widget/desktop_aura/desktop_focus_rules.h"
-
-#include "ui/aura/client/focus_client.h"
-#include "ui/aura/test/test_window_delegate.h"
-#include "ui/aura/window.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/aura/window_layer_type.h"
-#include "ui/views/corewm/window_util.h"
-#include "ui/views/test/views_test_base.h"
-#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
-#include "ui/views/widget/widget.h"
-
-namespace views {
-
-namespace {
-
-scoped_ptr<Widget> CreateDesktopWidget() {
- scoped_ptr<Widget> widget(new Widget);
- Widget::InitParams params = Widget::InitParams(
- Widget::InitParams::TYPE_WINDOW);
- params.bounds = gfx::Rect(0, 0, 200, 200);
- params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- params.native_widget = new DesktopNativeWidgetAura(widget.get());
- widget->Init(params);
- return widget.Pass();
-}
-
-} // namespace
-
-typedef ViewsTestBase DesktopFocusRulesTest;
-
-// Verifies we don't attempt to activate a window in another widget.
-TEST_F(DesktopFocusRulesTest, DontFocusWindowsInOtherHierarchies) {
- // Two widgets (each with a DesktopNativeWidgetAura). |w2| has a child Window
- // |w2_child| that is not focusable. |w2_child|'s has a transient parent in
- // |w1|.
- scoped_ptr<views::Widget> w1(CreateDesktopWidget());
- scoped_ptr<views::Widget> w2(CreateDesktopWidget());
- aura::test::TestWindowDelegate w2_child_delegate;
- w2_child_delegate.set_can_focus(false);
- aura::Window* w2_child = new aura::Window(&w2_child_delegate);
- w2_child->Init(aura::WINDOW_LAYER_SOLID_COLOR);
- w2->GetNativeView()->AddChild(w2_child);
- views::corewm::AddTransientChild(w1->GetNativeView(), w2_child);
- aura::client::GetFocusClient(w2->GetNativeView())->FocusWindow(w2_child);
- aura::Window* focused =
- aura::client::GetFocusClient(w2->GetNativeView())->GetFocusedWindow();
- EXPECT_TRUE((focused == NULL) || w2->GetNativeView()->Contains(focused));
- views::corewm::RemoveTransientChild(w1->GetNativeView(), w2_child);
- w1.reset();
- w2.reset();
-}
-
-} // namespace views
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_focus_rules.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698