| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 2340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2351 // This test verifies that WebWidgetClient::hasTouchEventHandlers is called | 2351 // This test verifies that WebWidgetClient::hasTouchEventHandlers is called |
| 2352 // accordingly for various calls to EventHandlerRegistry::did{Add|Remove| | 2352 // accordingly for various calls to EventHandlerRegistry::did{Add|Remove| |
| 2353 // RemoveAll}EventHandler(..., TouchEvent). Verifying that those calls are made | 2353 // RemoveAll}EventHandler(..., TouchEvent). Verifying that those calls are made |
| 2354 // correctly is the job of LayoutTests/fast/events/event-handler-count.html. | 2354 // correctly is the job of LayoutTests/fast/events/event-handler-count.html. |
| 2355 TEST_F(WebViewTest, HasTouchEventHandlers) | 2355 TEST_F(WebViewTest, HasTouchEventHandlers) |
| 2356 { | 2356 { |
| 2357 TouchEventHandlerWebViewClient client; | 2357 TouchEventHandlerWebViewClient client; |
| 2358 std::string url = m_baseURL + "has_touch_event_handlers.html"; | 2358 std::string url = m_baseURL + "has_touch_event_handlers.html"; |
| 2359 URLTestHelpers::registerMockedURLLoad(toKURL(url), "has_touch_event_handlers
.html"); | 2359 URLTestHelpers::registerMockedURLLoad(toKURL(url), "has_touch_event_handlers
.html"); |
| 2360 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(url, true, 0, &
client); | 2360 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(url, true, 0, &
client); |
| 2361 const EventHandlerRegistry::EventHandlerClass touchEvent = EventHandlerRegis
try::TouchEventBlocking; | 2361 const EventHandlerRegistry::EventHandlerClass touchEvent = EventHandlerRegis
try::TouchStartOrMoveEventBlocking; |
| 2362 | 2362 |
| 2363 // The page is initialized with at least one no-handlers call. | 2363 // The page is initialized with at least one no-handlers call. |
| 2364 // In practice we get two such calls because WebViewHelper::initializeAndLoa
d first | 2364 // In practice we get two such calls because WebViewHelper::initializeAndLoa
d first |
| 2365 // initializes and empty frame, and then loads a document into it, so there
are two | 2365 // initializes and empty frame, and then loads a document into it, so there
are two |
| 2366 // FrameLoader::commitProvisionalLoad calls. | 2366 // FrameLoader::commitProvisionalLoad calls. |
| 2367 EXPECT_GE(client.getAndResetHasTouchEventHandlerCallCount(false), 1); | 2367 EXPECT_GE(client.getAndResetHasTouchEventHandlerCallCount(false), 1); |
| 2368 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 2368 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
| 2369 | 2369 |
| 2370 // Adding the first document handler results in a has-handlers call. | 2370 // Adding the first document handler results in a has-handlers call. |
| 2371 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 2371 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3291 frame->setAutofillClient(&client); | 3291 frame->setAutofillClient(&client); |
| 3292 webView->setInitialFocus(false); | 3292 webView->setInitialFocus(false); |
| 3293 | 3293 |
| 3294 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3294 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3295 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3295 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3296 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3296 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3297 frame->setAutofillClient(0); | 3297 frame->setAutofillClient(0); |
| 3298 } | 3298 } |
| 3299 | 3299 |
| 3300 } // namespace blink | 3300 } // namespace blink |
| OLD | NEW |