| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/win/metro.h" | 6 #include "base/win/metro.h" |
| 7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
| 9 #include "content/public/test/test_utils.h" | 9 #include "content/public/test/test_utils.h" |
| 10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| 11 #include "content/shell/shell.h" | 11 #include "content/shell/shell.h" |
| 12 #include "content/test/content_browser_test_utils.h" | 12 #include "content/test/content_browser_test_utils.h" |
| 13 #include "content/test/content_browser_test.h" | 13 #include "content/test/content_browser_test.h" |
| 14 #include "ui/base/ime/text_input_type.h" | 14 #include "ui/base/ime/text_input_type.h" |
| 15 #include "ui/base/win/mock_tsf_bridge.h" | 15 #include "ui/base/win/mock_tsf_bridge.h" |
| 16 #include "ui/base/win/tsf_bridge.h" | 16 #include "ui/base/win/tsf_bridge.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 class RenderWidgetHostViewWinTest : public content::ContentBrowserTest { | 19 class RenderWidgetHostViewWinTest : public content::ContentBrowserTest { |
| 20 public: | 20 public: |
| 21 RenderWidgetHostViewWinTest() {} | 21 RenderWidgetHostViewWinTest() {} |
| 22 | 22 |
| 23 virtual void SetUpCommandLine(CommandLine* command_line) { | 23 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 24 command_line->AppendSwitch(switches::kEnableTextServicesFramework); | 24 command_line->AppendSwitch(switches::kEnableTextServicesFramework); |
| 25 } | 25 } |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, SwichToPasswordField) { | 28 // crbug.com/151798 |
| 29 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, |
| 30 DISABLED_SwichToPasswordField) { |
| 29 ui::MockTsfBridge mock_bridge; | 31 ui::MockTsfBridge mock_bridge; |
| 30 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); | 32 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); |
| 31 GURL test_url = content::GetTestUrl("textinput", | 33 GURL test_url = content::GetTestUrl("textinput", |
| 32 "ime_enable_disable_test.html"); | 34 "ime_enable_disable_test.html"); |
| 33 | 35 |
| 34 content::NavigateToURL(shell(), test_url); | 36 content::NavigateToURL(shell(), test_url); |
| 35 content::WaitForLoadStop(shell()->web_contents()); | 37 content::WaitForLoadStop(shell()->web_contents()); |
| 36 content::RunAllPendingInMessageLoop(); | 38 content::RunAllPendingInMessageLoop(); |
| 37 | 39 |
| 38 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); | 40 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 55 L"window.domAutomationController.send(password02_focus());", | 57 L"window.domAutomationController.send(password02_focus());", |
| 56 &success)); | 58 &success)); |
| 57 EXPECT_TRUE(success); | 59 EXPECT_TRUE(success); |
| 58 content::WaitForLoadStop(shell()->web_contents()); | 60 content::WaitForLoadStop(shell()->web_contents()); |
| 59 content::RunAllPendingInMessageLoop(); | 61 content::RunAllPendingInMessageLoop(); |
| 60 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, mock_bridge.latest_text_iput_type()); | 62 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, mock_bridge.latest_text_iput_type()); |
| 61 | 63 |
| 62 ui::TsfBridge::ReplaceForTesting(old_bridge); | 64 ui::TsfBridge::ReplaceForTesting(old_bridge); |
| 63 } | 65 } |
| 64 | 66 |
| 65 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, SwitchToSameField) { | 67 // crbug.com/151798 |
| 68 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, |
| 69 DISABLED_SwitchToSameField) { |
| 66 ui::MockTsfBridge mock_bridge; | 70 ui::MockTsfBridge mock_bridge; |
| 67 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); | 71 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); |
| 68 GURL test_url = content::GetTestUrl("textinput", | 72 GURL test_url = content::GetTestUrl("textinput", |
| 69 "ime_enable_disable_test.html"); | 73 "ime_enable_disable_test.html"); |
| 70 | 74 |
| 71 content::NavigateToURL(shell(), test_url); | 75 content::NavigateToURL(shell(), test_url); |
| 72 content::WaitForLoadStop(shell()->web_contents()); | 76 content::WaitForLoadStop(shell()->web_contents()); |
| 73 content::RunAllPendingInMessageLoop(); | 77 content::RunAllPendingInMessageLoop(); |
| 74 | 78 |
| 75 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); | 79 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 92 L"window.domAutomationController.send(text02_focus());", | 96 L"window.domAutomationController.send(text02_focus());", |
| 93 &success)); | 97 &success)); |
| 94 EXPECT_TRUE(success); | 98 EXPECT_TRUE(success); |
| 95 content::WaitForLoadStop(shell()->web_contents()); | 99 content::WaitForLoadStop(shell()->web_contents()); |
| 96 content::RunAllPendingInMessageLoop(); | 100 content::RunAllPendingInMessageLoop(); |
| 97 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, mock_bridge.latest_text_iput_type()); | 101 EXPECT_EQ(ui::TEXT_INPUT_TYPE_TEXT, mock_bridge.latest_text_iput_type()); |
| 98 | 102 |
| 99 ui::TsfBridge::ReplaceForTesting(old_bridge); | 103 ui::TsfBridge::ReplaceForTesting(old_bridge); |
| 100 } | 104 } |
| 101 | 105 |
| 102 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, SwitchToSamePasswordField) { | 106 // crbug.com/151798 |
| 107 IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewWinTest, |
| 108 DISABLED_SwitchToSamePasswordField) { |
| 103 ui::MockTsfBridge mock_bridge; | 109 ui::MockTsfBridge mock_bridge; |
| 104 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); | 110 ui::TsfBridge* old_bridge = ui::TsfBridge::ReplaceForTesting(&mock_bridge); |
| 105 GURL test_url = content::GetTestUrl("textinput", | 111 GURL test_url = content::GetTestUrl("textinput", |
| 106 "ime_enable_disable_test.html"); | 112 "ime_enable_disable_test.html"); |
| 107 | 113 |
| 108 content::NavigateToURL(shell(), test_url); | 114 content::NavigateToURL(shell(), test_url); |
| 109 content::WaitForLoadStop(shell()->web_contents()); | 115 content::WaitForLoadStop(shell()->web_contents()); |
| 110 content::RunAllPendingInMessageLoop(); | 116 content::RunAllPendingInMessageLoop(); |
| 111 | 117 |
| 112 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); | 118 EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, mock_bridge.latest_text_iput_type()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 129 L"window.domAutomationController.send(password02_focus());", | 135 L"window.domAutomationController.send(password02_focus());", |
| 130 &success)); | 136 &success)); |
| 131 EXPECT_TRUE(success); | 137 EXPECT_TRUE(success); |
| 132 content::WaitForLoadStop(shell()->web_contents()); | 138 content::WaitForLoadStop(shell()->web_contents()); |
| 133 content::RunAllPendingInMessageLoop(); | 139 content::RunAllPendingInMessageLoop(); |
| 134 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, mock_bridge.latest_text_iput_type()); | 140 EXPECT_EQ(ui::TEXT_INPUT_TYPE_PASSWORD, mock_bridge.latest_text_iput_type()); |
| 135 | 141 |
| 136 ui::TsfBridge::ReplaceForTesting(old_bridge); | 142 ui::TsfBridge::ReplaceForTesting(old_bridge); |
| 137 } | 143 } |
| 138 } // namespace | 144 } // namespace |
| OLD | NEW |