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 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 // This test verifies that WebWidgetClient::hasTouchEventHandlers is called | 2285 // This test verifies that WebWidgetClient::hasTouchEventHandlers is called |
2286 // accordingly for various calls to EventHandlerRegistry::did{Add|Remove| | 2286 // accordingly for various calls to EventHandlerRegistry::did{Add|Remove| |
2287 // RemoveAll}EventHandler(..., TouchEvent). Verifying that those calls are made | 2287 // RemoveAll}EventHandler(..., TouchEvent). Verifying that those calls are made |
2288 // correctly is the job of LayoutTests/fast/events/event-handler-count.html. | 2288 // correctly is the job of LayoutTests/fast/events/event-handler-count.html. |
2289 TEST_F(WebViewTest, HasTouchEventHandlers) | 2289 TEST_F(WebViewTest, HasTouchEventHandlers) |
2290 { | 2290 { |
2291 TouchEventHandlerWebViewClient client; | 2291 TouchEventHandlerWebViewClient client; |
2292 std::string url = m_baseURL + "has_touch_event_handlers.html"; | 2292 std::string url = m_baseURL + "has_touch_event_handlers.html"; |
2293 URLTestHelpers::registerMockedURLLoad(toKURL(url), "has_touch_event_handlers
.html"); | 2293 URLTestHelpers::registerMockedURLLoad(toKURL(url), "has_touch_event_handlers
.html"); |
2294 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(url, true, 0, &
client); | 2294 WebViewImpl* webViewImpl = m_webViewHelper.initializeAndLoad(url, true, 0, &
client); |
2295 const EventHandlerRegistry::EventHandlerClass touchEvent = EventHandlerRegis
try::TouchEvent; | 2295 const EventHandlerRegistry::EventHandlerClass touchEvent = EventHandlerRegis
try::TouchEventBlocking; |
2296 | 2296 |
2297 // The page is initialized with at least one no-handlers call. | 2297 // The page is initialized with at least one no-handlers call. |
2298 // In practice we get two such calls because WebViewHelper::initializeAndLoa
d first | 2298 // In practice we get two such calls because WebViewHelper::initializeAndLoa
d first |
2299 // initializes and empty frame, and then loads a document into it, so there
are two | 2299 // initializes and empty frame, and then loads a document into it, so there
are two |
2300 // FrameLoader::commitProvisionalLoad calls. | 2300 // FrameLoader::commitProvisionalLoad calls. |
2301 EXPECT_GE(client.getAndResetHasTouchEventHandlerCallCount(false), 1); | 2301 EXPECT_GE(client.getAndResetHasTouchEventHandlerCallCount(false), 1); |
2302 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 2302 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
2303 | 2303 |
2304 // Adding the first document handler results in a has-handlers call. | 2304 // Adding the first document handler results in a has-handlers call. |
2305 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); | 2305 Document* document = webViewImpl->mainFrameImpl()->frame()->document(); |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 result = WebSubstringUtil::attributedSubstringInRange(frame, 5, 5, &baseline
Point); | 3210 result = WebSubstringUtil::attributedSubstringInRange(frame, 5, 5, &baseline
Point); |
3211 ASSERT_TRUE(!!result); | 3211 ASSERT_TRUE(!!result); |
3212 | 3212 |
3213 point = WebPoint(baselinePoint.x, frameView->height() - baselinePoint.y); | 3213 point = WebPoint(baselinePoint.x, frameView->height() - baselinePoint.y); |
3214 result = WebSubstringUtil::attributedWordAtPoint(webView, point, baselinePoi
nt); | 3214 result = WebSubstringUtil::attributedWordAtPoint(webView, point, baselinePoi
nt); |
3215 ASSERT_TRUE(!!result); | 3215 ASSERT_TRUE(!!result); |
3216 } | 3216 } |
3217 #endif | 3217 #endif |
3218 | 3218 |
3219 } // namespace blink | 3219 } // namespace blink |
OLD | NEW |