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

Side by Side Diff: views/widget/widget_unittest.cc

Issue 7729007: Focus/InputMethod fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/widget.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/native_widget_views.h" 5 #include "views/widget/native_widget_views.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 MouseEvent released2(ui::ET_MOUSE_RELEASED, 315, 45, ui::EF_LEFT_BUTTON_DOWN); 265 MouseEvent released2(ui::ET_MOUSE_RELEASED, 315, 45, ui::EF_LEFT_BUTTON_DOWN);
266 toplevel->OnMouseEvent(released2); 266 toplevel->OnMouseEvent(released2);
267 EXPECT_FALSE(WidgetHasMouseCapture(toplevel)); 267 EXPECT_FALSE(WidgetHasMouseCapture(toplevel));
268 EXPECT_FALSE(WidgetHasMouseCapture(child1)); 268 EXPECT_FALSE(WidgetHasMouseCapture(child1));
269 EXPECT_FALSE(WidgetHasMouseCapture(child2)); 269 EXPECT_FALSE(WidgetHasMouseCapture(child2));
270 270
271 toplevel->CloseNow(); 271 toplevel->CloseNow();
272 } 272 }
273 273
274 // Test if a focus manager and an inputmethod work without CHECK failure
275 // when window activation changes.
276 TEST_F(WidgetTest, ChangeActivation) {
277 Widget* top1 = CreateTopLevelPlatformWidget();
278 // CreateInputMethod before activated
279 top1->GetInputMethod();
280 top1->Show();
281 RunPendingMessages();
282
283 Widget* top2 = CreateTopLevelPlatformWidget();
284 top2->Show();
285 RunPendingMessages();
286
287 top1->Activate();
288 RunPendingMessages();
289
290 // Create InputMethod after deactivated.
291 top2->GetInputMethod();
292 top2->Activate();
293 RunPendingMessages();
294
295 top1->Activate();
296 RunPendingMessages();
297
298 top1->CloseNow();
299 top2->CloseNow();
300 }
301
274 //////////////////////////////////////////////////////////////////////////////// 302 ////////////////////////////////////////////////////////////////////////////////
275 // Widget ownership tests. 303 // Widget ownership tests.
276 // 304 //
277 // Tests various permutations of Widget ownership specified in the 305 // Tests various permutations of Widget ownership specified in the
278 // InitParams::Ownership param. 306 // InitParams::Ownership param.
279 307
280 // A WidgetTest that supplies a toplevel widget for NativeWidgetViews to parent 308 // A WidgetTest that supplies a toplevel widget for NativeWidgetViews to parent
281 // to. 309 // to.
282 class WidgetOwnershipTest : public WidgetTest { 310 class WidgetOwnershipTest : public WidgetTest {
283 public: 311 public:
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 701
674 child1->Show(); 702 child1->Show();
675 EXPECT_EQ(child1, widget_shown()); 703 EXPECT_EQ(child1, widget_shown());
676 704
677 child2->Show(); 705 child2->Show();
678 EXPECT_EQ(child2, widget_shown()); 706 EXPECT_EQ(child2, widget_shown());
679 } 707 }
680 708
681 } // namespace 709 } // namespace
682 } // namespace views 710 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698