| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 6996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7007 TestSameDocumentWithImageWebFrameClient client; | 7007 TestSameDocumentWithImageWebFrameClient client; |
| 7008 FrameTestHelpers::WebViewHelper webViewHelper; | 7008 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7009 webViewHelper.initializeAndLoad(m_baseURL + "foo_with_image.html", true, | 7009 webViewHelper.initializeAndLoad(m_baseURL + "foo_with_image.html", true, |
| 7010 &client, nullptr, nullptr, | 7010 &client, nullptr, nullptr, |
| 7011 &configureLoadsImagesAutomatically); | 7011 &configureLoadsImagesAutomatically); |
| 7012 | 7012 |
| 7013 WebCache::clear(); | 7013 WebCache::clear(); |
| 7014 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), | 7014 FrameTestHelpers::loadFrame(webViewHelper.webView()->mainFrame(), |
| 7015 m_baseURL + "foo_with_image.html"); | 7015 m_baseURL + "foo_with_image.html"); |
| 7016 | 7016 |
| 7017 // 2 images are requested, and each triggers 2 willSendRequest() calls, | 7017 // 2 images are requested, and each triggers 1 willSendRequest() calls. |
| 7018 // once for preloading and once for the real request. | 7018 // Preload matches do not call willSendRequest(). |
| 7019 EXPECT_EQ(client.numOfImageRequests(), 4); | 7019 EXPECT_EQ(client.numOfImageRequests(), 2); |
| 7020 } | 7020 } |
| 7021 | 7021 |
| 7022 TEST_P(ParameterizedWebFrameTest, WebNodeImageContents) { | 7022 TEST_P(ParameterizedWebFrameTest, WebNodeImageContents) { |
| 7023 FrameTestHelpers::WebViewHelper webViewHelper; | 7023 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7024 webViewHelper.initializeAndLoad("about:blank", true); | 7024 webViewHelper.initializeAndLoad("about:blank", true); |
| 7025 WebFrame* frame = webViewHelper.webView()->mainFrame(); | 7025 WebFrame* frame = webViewHelper.webView()->mainFrame(); |
| 7026 | 7026 |
| 7027 static const char bluePNG[] = | 7027 static const char bluePNG[] = |
| 7028 "<img " | 7028 "<img " |
| 7029 "src=\"data:image/" | 7029 "src=\"data:image/" |
| (...skipping 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10252 webViewHelper.webView()->handleInputEvent(endEvent); | 10252 webViewHelper.webView()->handleInputEvent(endEvent); |
| 10253 webViewHelper.webView()->handleInputEvent(updateEvent); | 10253 webViewHelper.webView()->handleInputEvent(updateEvent); |
| 10254 | 10254 |
| 10255 // Try a full Begin/Update/End cycle. | 10255 // Try a full Begin/Update/End cycle. |
| 10256 webViewHelper.webView()->handleInputEvent(beginEvent); | 10256 webViewHelper.webView()->handleInputEvent(beginEvent); |
| 10257 webViewHelper.webView()->handleInputEvent(updateEvent); | 10257 webViewHelper.webView()->handleInputEvent(updateEvent); |
| 10258 webViewHelper.webView()->handleInputEvent(endEvent); | 10258 webViewHelper.webView()->handleInputEvent(endEvent); |
| 10259 } | 10259 } |
| 10260 | 10260 |
| 10261 } // namespace blink | 10261 } // namespace blink |
| OLD | NEW |