OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 ActivateSync(parent); | 1575 ActivateSync(parent); |
1576 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, | 1576 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, |
1577 parent->GetInputMethod()->GetTextInputType()); | 1577 parent->GetInputMethod()->GetTextInputType()); |
1578 #endif | 1578 #endif |
1579 | 1579 |
1580 parent->CloseNow(); | 1580 parent->CloseNow(); |
1581 } | 1581 } |
1582 | 1582 |
1583 // Test input method focus changes affected by focus changes cross 2 top | 1583 // Test input method focus changes affected by focus changes cross 2 top |
1584 // windows. | 1584 // windows. |
1585 // Flaky: https://crbug.com/484836 | 1585 TEST_F(WidgetInputMethodInteractiveTest, TwoTopWindows) { |
1586 TEST_F(WidgetInputMethodInteractiveTest, DISABLED_TwoTopWindows) { | |
1587 Widget* widget1 = CreateWidget(); | 1586 Widget* widget1 = CreateWidget(); |
1588 Widget* widget2 = CreateWidget(); | 1587 Widget* widget2 = CreateWidget(); |
1589 Textfield* textfield1 = new Textfield; | 1588 Textfield* textfield1 = new Textfield; |
1590 Textfield* textfield2 = new Textfield; | 1589 Textfield* textfield2 = new Textfield; |
1591 textfield2->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); | 1590 textfield2->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
1592 widget1->GetRootView()->AddChildView(textfield1); | 1591 widget1->GetRootView()->AddChildView(textfield1); |
1593 widget2->GetRootView()->AddChildView(textfield2); | 1592 widget2->GetRootView()->AddChildView(textfield2); |
1594 widget1->Show(); | 1593 |
1595 widget2->Show(); | 1594 // Do the initial shows synchronously. Otherwise, on X11, the window server |
| 1595 // messages may be interleaved with the activation requests below. |
| 1596 ShowSync(widget1); |
| 1597 ShowSync(widget2); |
1596 | 1598 |
1597 textfield1->RequestFocus(); | 1599 textfield1->RequestFocus(); |
1598 textfield2->RequestFocus(); | 1600 textfield2->RequestFocus(); |
1599 | 1601 |
1600 ActivateSync(widget1); | 1602 ActivateSync(widget1); |
1601 | 1603 |
1602 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, | 1604 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, |
1603 widget1->GetInputMethod()->GetTextInputType()); | 1605 widget1->GetInputMethod()->GetTextInputType()); |
1604 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, | 1606 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, |
1605 widget2->GetInputMethod()->GetTextInputType()); | 1607 widget2->GetInputMethod()->GetTextInputType()); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 widget->GetInputMethod()->GetTextInputType()); | 1639 widget->GetInputMethod()->GetTextInputType()); |
1638 | 1640 |
1639 textfield->SetReadOnly(true); | 1641 textfield->SetReadOnly(true); |
1640 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, | 1642 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, |
1641 widget->GetInputMethod()->GetTextInputType()); | 1643 widget->GetInputMethod()->GetTextInputType()); |
1642 widget->CloseNow(); | 1644 widget->CloseNow(); |
1643 } | 1645 } |
1644 | 1646 |
1645 } // namespace test | 1647 } // namespace test |
1646 } // namespace views | 1648 } // namespace views |
OLD | NEW |