| 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 10459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10470 | 10470 |
| 10471 FrameTestHelpers::WebViewHelper helper; | 10471 FrameTestHelpers::WebViewHelper helper; |
| 10472 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client); | 10472 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client); |
| 10473 client.verifyAllRequests(); | 10473 client.verifyAllRequests(); |
| 10474 } | 10474 } |
| 10475 | 10475 |
| 10476 class MultipleDataChunkDelegate : public WebURLLoaderTestDelegate { | 10476 class MultipleDataChunkDelegate : public WebURLLoaderTestDelegate { |
| 10477 public: | 10477 public: |
| 10478 void didReceiveData(WebURLLoaderClient* originalClient, | 10478 void didReceiveData(WebURLLoaderClient* originalClient, |
| 10479 const char* data, | 10479 const char* data, |
| 10480 int dataLength, | 10480 int dataLength) override { |
| 10481 int encodedDataLength) override { | |
| 10482 EXPECT_GT(dataLength, 16); | 10481 EXPECT_GT(dataLength, 16); |
| 10483 originalClient->didReceiveData(data, 16, 16); | 10482 originalClient->didReceiveData(data, 16); |
| 10484 // This didReceiveData call shouldn't crash due to a failed assertion. | 10483 // This didReceiveData call shouldn't crash due to a failed assertion. |
| 10485 originalClient->didReceiveData(data + 16, dataLength - 16, | 10484 originalClient->didReceiveData(data + 16, dataLength - 16); |
| 10486 encodedDataLength - 16); | |
| 10487 } | 10485 } |
| 10488 }; | 10486 }; |
| 10489 | 10487 |
| 10490 TEST_F(WebFrameTest, ImageDocumentDecodeError) { | 10488 TEST_F(WebFrameTest, ImageDocumentDecodeError) { |
| 10491 std::string url = m_baseURL + "not_an_image.ico"; | 10489 std::string url = m_baseURL + "not_an_image.ico"; |
| 10492 URLTestHelpers::registerMockedURLLoad(toKURL(url), "not_an_image.ico", | 10490 URLTestHelpers::registerMockedURLLoad(toKURL(url), "not_an_image.ico", |
| 10493 "image/x-icon"); | 10491 "image/x-icon"); |
| 10494 MultipleDataChunkDelegate delegate; | 10492 MultipleDataChunkDelegate delegate; |
| 10495 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate); | 10493 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate); |
| 10496 FrameTestHelpers::WebViewHelper helper; | 10494 FrameTestHelpers::WebViewHelper helper; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11005 | 11003 |
| 11006 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 11004 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 11007 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 11005 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 11008 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 11006 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 11009 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 11007 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 11010 | 11008 |
| 11011 webViewHelper.reset(); | 11009 webViewHelper.reset(); |
| 11012 } | 11010 } |
| 11013 | 11011 |
| 11014 } // namespace blink | 11012 } // namespace blink |
| OLD | NEW |