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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 KURL(toKURL(m_baseURL), "non_existent.png")); | 339 KURL(toKURL(m_baseURL), "non_existent.png")); |
340 std::string url = registerMockedHttpURLLoad("image-broken.html"); | 340 std::string url = registerMockedHttpURLLoad("image-broken.html"); |
341 | 341 |
342 WebView* webView = m_webViewHelper.initialize(); | 342 WebView* webView = m_webViewHelper.initialize(); |
343 webView->settings()->setLoadsImagesAutomatically(true); | 343 webView->settings()->setLoadsImagesAutomatically(true); |
344 loadFrame(webView->mainFrame(), url); | 344 loadFrame(webView->mainFrame(), url); |
345 webView->resize(WebSize(400, 400)); | 345 webView->resize(WebSize(400, 400)); |
346 | 346 |
347 std::string imageUrl = "http://www.test.com/non_existent.png"; | 347 std::string imageUrl = "http://www.test.com/non_existent.png"; |
348 | 348 |
349 EXPECT_EQ("image", hitTestElementId(webView, 25, 25)); | 349 EXPECT_EQ("image", hitTestElementId(webView, 12, 12)); |
350 EXPECT_TRUE(hitTestUrlElement(webView, 25, 25).isNull()); | 350 EXPECT_TRUE(hitTestUrlElement(webView, 25, 25).isNull()); |
351 EXPECT_EQ(imageUrl, hitTestAbsoluteUrl(webView, 25, 25)); | 351 EXPECT_EQ(imageUrl, hitTestAbsoluteUrl(webView, 12, 12)); |
352 } | 352 } |
353 | 353 |
354 TEST_P(WebViewTest, BrokenInputImage) { | 354 TEST_P(WebViewTest, BrokenInputImage) { |
355 URLTestHelpers::registerMockedErrorURLLoad( | 355 URLTestHelpers::registerMockedErrorURLLoad( |
356 KURL(toKURL(m_baseURL), "non_existent.png")); | 356 KURL(toKURL(m_baseURL), "non_existent.png")); |
357 std::string url = registerMockedHttpURLLoad("input-image-broken.html"); | 357 std::string url = registerMockedHttpURLLoad("input-image-broken.html"); |
358 | 358 |
359 WebView* webView = m_webViewHelper.initialize(); | 359 WebView* webView = m_webViewHelper.initialize(); |
360 webView->settings()->setLoadsImagesAutomatically(true); | 360 webView->settings()->setLoadsImagesAutomatically(true); |
361 loadFrame(webView->mainFrame(), url); | 361 loadFrame(webView->mainFrame(), url); |
(...skipping 3971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); | 4333 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); |
4334 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 4334 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
4335 EXPECT_NE(nullptr, | 4335 EXPECT_NE(nullptr, |
4336 frameView->layoutViewportScrollableArea()->verticalScrollbar()); | 4336 frameView->layoutViewportScrollableArea()->verticalScrollbar()); |
4337 } else { | 4337 } else { |
4338 EXPECT_NE(nullptr, frameView->verticalScrollbar()); | 4338 EXPECT_NE(nullptr, frameView->verticalScrollbar()); |
4339 } | 4339 } |
4340 } | 4340 } |
4341 | 4341 |
4342 } // namespace blink | 4342 } // namespace blink |
OLD | NEW |