OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 if (expectedAction == "auto") { | 255 if (expectedAction == "auto") { |
256 // Auto is the default - no action set. | 256 // Auto is the default - no action set. |
257 EXPECT_EQ(0, client.touchActionSetCount()) << failureContextPos; | 257 EXPECT_EQ(0, client.touchActionSetCount()) << failureContextPos; |
258 EXPECT_EQ(WebTouchActionAuto, client.lastTouchAction()) << failu
reContextPos; | 258 EXPECT_EQ(WebTouchActionAuto, client.lastTouchAction()) << failu
reContextPos; |
259 } else { | 259 } else { |
260 // Should have received exactly one touch action. | 260 // Should have received exactly one touch action. |
261 EXPECT_EQ(1, client.touchActionSetCount()) << failureContextPos; | 261 EXPECT_EQ(1, client.touchActionSetCount()) << failureContextPos; |
262 if (client.touchActionSetCount()) { | 262 if (client.touchActionSetCount()) { |
263 if (expectedAction == "none") { | 263 if (expectedAction == "none") { |
264 EXPECT_EQ(WebTouchActionNone, client.lastTouchAction())
<< failureContextPos; | 264 EXPECT_EQ(WebTouchActionNone, client.lastTouchAction())
<< failureContextPos; |
| 265 } else if (expectedAction == "pan-x") { |
| 266 EXPECT_EQ(WebTouchActionPanX, client.lastTouchAction())
<< failureContextPos; |
| 267 } else if (expectedAction == "pan-y") { |
| 268 EXPECT_EQ(WebTouchActionPanY, client.lastTouchAction())
<< failureContextPos; |
| 269 } else if (expectedAction == "pan-x-y") { |
| 270 EXPECT_EQ((WebTouchActionPanX | WebTouchActionPanY), cli
ent.lastTouchAction()) << failureContextPos; |
265 } else { | 271 } else { |
266 FAIL() << "Unrecognized expected-action \"" << expectedA
ction.string().ascii().data() | 272 FAIL() << "Unrecognized expected-action \"" << expectedA
ction.string().ascii().data() |
267 << "\" " << failureContextPos; | 273 << "\" " << failureContextPos; |
268 } | 274 } |
269 } | 275 } |
270 } | 276 } |
271 | 277 |
272 // Reset webview touch state. | 278 // Reset webview touch state. |
273 client.reset(); | 279 client.reset(); |
274 sendTouchEvent(webView, WebInputEvent::TouchCancel, clientPoint); | 280 sendTouchEvent(webView, WebInputEvent::TouchCancel, clientPoint); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 TEST_F(TouchActionTest, Overflow) | 312 TEST_F(TouchActionTest, Overflow) |
307 { | 313 { |
308 runTouchActionTest("touch-action-overflow.html"); | 314 runTouchActionTest("touch-action-overflow.html"); |
309 } | 315 } |
310 | 316 |
311 TEST_F(TouchActionTest, ShadowDOM) | 317 TEST_F(TouchActionTest, ShadowDOM) |
312 { | 318 { |
313 runShadowDOMTest("touch-action-shadow-dom.html"); | 319 runShadowDOMTest("touch-action-shadow-dom.html"); |
314 } | 320 } |
315 | 321 |
| 322 TEST_F(TouchActionTest, Pan) |
| 323 { |
| 324 runTouchActionTest("touch-action-pan.html"); |
316 } | 325 } |
| 326 |
| 327 } |
OLD | NEW |