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 <mshtmcid.h> | 5 #include <mshtmcid.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/test/test_file_util.h" | 8 #include "base/test/test_file_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/win/scoped_bstr.h" | 10 #include "base/win/scoped_bstr.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bkspace, | 106 bkspace, |
107 simulate_input::SHIFT))); | 107 simulate_input::SHIFT))); |
108 | 108 |
109 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(page2))) | 109 EXPECT_CALL(ie_mock_, OnLoad(in_cf, StrEq(page2))) |
110 .WillOnce(CloseBrowserMock(&ie_mock_)); | 110 .WillOnce(CloseBrowserMock(&ie_mock_)); |
111 | 111 |
112 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); | 112 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); |
113 } | 113 } |
114 | 114 |
115 // Tests new window behavior with ctrl+N. | 115 // Tests new window behavior with ctrl+N. |
116 TEST_P(FullTabUITest, CtrlN) { | 116 // Flaky due to DelaySendChar; see http://crbug.com/124244. |
| 117 TEST_P(FullTabUITest, FLAKY_CtrlN) { |
117 if (IsWorkstationLocked()) { | 118 if (IsWorkstationLocked()) { |
118 LOG(ERROR) << "This test cannot be run in a locked workstation."; | 119 LOG(ERROR) << "This test cannot be run in a locked workstation."; |
119 return; | 120 return; |
120 } | 121 } |
121 | 122 |
122 bool is_cf = GetParam().invokes_cf(); | 123 bool is_cf = GetParam().invokes_cf(); |
123 if (!is_cf) { | 124 if (!is_cf) { |
124 LOG(ERROR) << "Test not implemented for this configuration."; | 125 LOG(ERROR) << "Test not implemented for this configuration."; |
125 return; | 126 return; |
126 } | 127 } |
(...skipping 20 matching lines...) Expand all Loading... |
147 .WillOnce(testing::Return()); | 148 .WillOnce(testing::Return()); |
148 | 149 |
149 EXPECT_CALL(win_observer_mock, OnWindowClose(_)) | 150 EXPECT_CALL(win_observer_mock, OnWindowClose(_)) |
150 .Times(testing::AtMost(2)); | 151 .Times(testing::AtMost(2)); |
151 | 152 |
152 LaunchIENavigateAndLoop(GetSimplePageUrl(), | 153 LaunchIENavigateAndLoop(GetSimplePageUrl(), |
153 kChromeFrameVeryLongNavigationTimeout); | 154 kChromeFrameVeryLongNavigationTimeout); |
154 } | 155 } |
155 | 156 |
156 // Test that Ctrl+F opens the Find dialog. | 157 // Test that Ctrl+F opens the Find dialog. |
157 TEST_P(FullTabUITest, CtrlF) { | 158 // Flaky due to DelaySendChar; see http://crbug.com/124244. |
| 159 TEST_P(FullTabUITest, FLAKY_CtrlF) { |
158 if (IsWorkstationLocked()) { | 160 if (IsWorkstationLocked()) { |
159 LOG(ERROR) << "This test cannot be run in a locked workstation."; | 161 LOG(ERROR) << "This test cannot be run in a locked workstation."; |
160 return; | 162 return; |
161 } | 163 } |
162 | 164 |
163 bool is_cf = GetParam().invokes_cf(); | 165 bool is_cf = GetParam().invokes_cf(); |
164 if (!is_cf) { | 166 if (!is_cf) { |
165 LOG(ERROR) << "Test not implemented for this configuration."; | 167 LOG(ERROR) << "Test not implemented for this configuration."; |
166 return; | 168 return; |
167 } | 169 } |
(...skipping 12 matching lines...) Expand all Loading... |
180 simulate_input::CONTROL))); | 182 simulate_input::CONTROL))); |
181 | 183 |
182 EXPECT_CALL(win_observer_mock, OnWindowOpen(_)) | 184 EXPECT_CALL(win_observer_mock, OnWindowOpen(_)) |
183 .WillOnce(CloseBrowserMock(&ie_mock_)); | 185 .WillOnce(CloseBrowserMock(&ie_mock_)); |
184 | 186 |
185 LaunchIENavigateAndLoop(GetSimplePageUrl(), | 187 LaunchIENavigateAndLoop(GetSimplePageUrl(), |
186 kChromeFrameVeryLongNavigationTimeout); | 188 kChromeFrameVeryLongNavigationTimeout); |
187 } | 189 } |
188 | 190 |
189 // Test that ctrl+r does cause a refresh. | 191 // Test that ctrl+r does cause a refresh. |
190 TEST_P(FullTabUITest, CtrlR) { | 192 // Flaky due to DelaySendChar; see http://crbug.com/124244. |
| 193 TEST_P(FullTabUITest, FLAKY_CtrlR) { |
191 if (IsWorkstationLocked()) { | 194 if (IsWorkstationLocked()) { |
192 LOG(ERROR) << "This test cannot be run in a locked workstation."; | 195 LOG(ERROR) << "This test cannot be run in a locked workstation."; |
193 return; | 196 return; |
194 } | 197 } |
195 | 198 |
196 EXPECT_CALL(server_mock_, Get(_, UrlPathEq(GetSimplePageUrl()), _)) | 199 EXPECT_CALL(server_mock_, Get(_, UrlPathEq(GetSimplePageUrl()), _)) |
197 .Times(testing::AtMost(2)) | 200 .Times(testing::AtMost(2)) |
198 .WillRepeatedly(SendResponse(&server_mock_, GetParam())); | 201 .WillRepeatedly(SendResponse(&server_mock_, GetParam())); |
199 | 202 |
200 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), | 203 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), |
201 StrEq(GetSimplePageUrl()))) | 204 StrEq(GetSimplePageUrl()))) |
202 .Times(testing::AtMost(2)) | 205 .Times(testing::AtMost(2)) |
203 .WillOnce(testing::DoAll( | 206 .WillOnce(testing::DoAll( |
204 SetFocusToRenderer(&ie_mock_), | 207 SetFocusToRenderer(&ie_mock_), |
205 DelaySendChar(&loop_, | 208 DelaySendChar(&loop_, |
206 base::TimeDelta::FromSeconds(1), | 209 base::TimeDelta::FromSeconds(1), |
207 'r', | 210 'r', |
208 simulate_input::CONTROL), | 211 simulate_input::CONTROL), |
209 DelayCloseBrowserMock( | 212 DelayCloseBrowserMock( |
210 &loop_, base::TimeDelta::FromSeconds(4), &ie_mock_))) | 213 &loop_, base::TimeDelta::FromSeconds(4), &ie_mock_))) |
211 .WillRepeatedly(testing::Return()); | 214 .WillRepeatedly(testing::Return()); |
212 | 215 |
213 LaunchIENavigateAndLoop(GetSimplePageUrl(), | 216 LaunchIENavigateAndLoop(GetSimplePageUrl(), |
214 kChromeFrameVeryLongNavigationTimeout); | 217 kChromeFrameVeryLongNavigationTimeout); |
215 } | 218 } |
216 | 219 |
217 // Test window close with ctrl+w. | 220 // Test window close with ctrl+w. |
218 TEST_P(FullTabUITest, CtrlW) { | 221 // Flaky due to DelaySendChar; see http://crbug.com/124244. |
| 222 TEST_P(FullTabUITest, FLAKY_CtrlW) { |
219 if (IsWorkstationLocked()) { | 223 if (IsWorkstationLocked()) { |
220 LOG(ERROR) << "This test cannot be run in a locked workstation."; | 224 LOG(ERROR) << "This test cannot be run in a locked workstation."; |
221 return; | 225 return; |
222 } | 226 } |
223 | 227 |
224 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), | 228 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), |
225 StrEq(GetSimplePageUrl()))) | 229 StrEq(GetSimplePageUrl()))) |
226 .WillOnce(testing::DoAll( | 230 .WillOnce(testing::DoAll( |
227 SetFocusToRenderer(&ie_mock_), | 231 SetFocusToRenderer(&ie_mock_), |
228 DelaySendChar(&loop_, | 232 DelaySendChar(&loop_, |
229 base::TimeDelta::FromSeconds(1), | 233 base::TimeDelta::FromSeconds(1), |
230 'w', | 234 'w', |
231 simulate_input::CONTROL))); | 235 simulate_input::CONTROL))); |
232 | 236 |
233 LaunchIENavigateAndLoop(GetSimplePageUrl(), | 237 LaunchIENavigateAndLoop(GetSimplePageUrl(), |
234 kChromeFrameVeryLongNavigationTimeout); | 238 kChromeFrameVeryLongNavigationTimeout); |
235 } | 239 } |
236 | 240 |
237 // Test address bar navigation with Alt+d and URL. | 241 // Test address bar navigation with Alt+d and URL. |
238 TEST_P(FullTabUITest, AltD) { | 242 // Flaky due to TypeUrlInAddressBar; see http://crbug.com/124244. |
| 243 TEST_P(FullTabUITest, FLAKY_AltD) { |
239 if (IsWorkstationLocked()) { | 244 if (IsWorkstationLocked()) { |
240 LOG(ERROR) << "This test cannot be run in a locked workstation."; | 245 LOG(ERROR) << "This test cannot be run in a locked workstation."; |
241 return; | 246 return; |
242 } | 247 } |
243 | 248 |
244 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), | 249 EXPECT_CALL(ie_mock_, OnLoad(GetParam().invokes_cf(), |
245 StrEq(GetSimplePageUrl()))) | 250 StrEq(GetSimplePageUrl()))) |
246 .WillOnce(testing::DoAll( | 251 .WillOnce(testing::DoAll( |
247 SetFocusToRenderer(&ie_mock_), | 252 SetFocusToRenderer(&ie_mock_), |
248 TypeUrlInAddressBar(&loop_, | 253 TypeUrlInAddressBar(&loop_, |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) | 1055 EXPECT_CALL(acc_observer_, OnMenuPopup(_)) |
1051 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward"))); | 1056 .WillOnce(AccLeftClick(AccObjectMatcher(L"Forward"))); |
1052 | 1057 |
1053 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3))) | 1058 EXPECT_CALL(ie_mock_, OnLoad(IN_CF, StrEq(page3))) |
1054 .WillOnce(CloseBrowserMock(&ie_mock_)); | 1059 .WillOnce(CloseBrowserMock(&ie_mock_)); |
1055 | 1060 |
1056 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); | 1061 LaunchIENavigateAndLoop(page1, kChromeFrameVeryLongNavigationTimeout); |
1057 } | 1062 } |
1058 | 1063 |
1059 } // namespace chrome_frame_test | 1064 } // namespace chrome_frame_test |
OLD | NEW |