| 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 10321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10332 WebURLRequest::PriorityHigh); | 10332 WebURLRequest::PriorityHigh); |
| 10333 | 10333 |
| 10334 FrameTestHelpers::WebViewHelper helper; | 10334 FrameTestHelpers::WebViewHelper helper; |
| 10335 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client); | 10335 helper.initializeAndLoad(m_baseURL + "script_priority.html", true, &client); |
| 10336 client.verifyAllRequests(); | 10336 client.verifyAllRequests(); |
| 10337 } | 10337 } |
| 10338 | 10338 |
| 10339 class MultipleDataChunkDelegate : public WebURLLoaderTestDelegate { | 10339 class MultipleDataChunkDelegate : public WebURLLoaderTestDelegate { |
| 10340 public: | 10340 public: |
| 10341 void didReceiveData(WebURLLoaderClient* originalClient, | 10341 void didReceiveData(WebURLLoaderClient* originalClient, |
| 10342 WebURLLoader* loader, | |
| 10343 const char* data, | 10342 const char* data, |
| 10344 int dataLength, | 10343 int dataLength, |
| 10345 int encodedDataLength) override { | 10344 int encodedDataLength) override { |
| 10346 EXPECT_GT(dataLength, 16); | 10345 EXPECT_GT(dataLength, 16); |
| 10347 originalClient->didReceiveData(loader, data, 16, 16); | 10346 originalClient->didReceiveData(data, 16, 16); |
| 10348 // This didReceiveData call shouldn't crash due to a failed assertion. | 10347 // This didReceiveData call shouldn't crash due to a failed assertion. |
| 10349 originalClient->didReceiveData(loader, data + 16, dataLength - 16, | 10348 originalClient->didReceiveData(data + 16, dataLength - 16, |
| 10350 encodedDataLength - 16); | 10349 encodedDataLength - 16); |
| 10351 } | 10350 } |
| 10352 }; | 10351 }; |
| 10353 | 10352 |
| 10354 TEST_F(WebFrameTest, ImageDocumentDecodeError) { | 10353 TEST_F(WebFrameTest, ImageDocumentDecodeError) { |
| 10355 std::string url = m_baseURL + "not_an_image.ico"; | 10354 std::string url = m_baseURL + "not_an_image.ico"; |
| 10356 URLTestHelpers::registerMockedURLLoad(toKURL(url), "not_an_image.ico", | 10355 URLTestHelpers::registerMockedURLLoad(toKURL(url), "not_an_image.ico", |
| 10357 "image/x-icon"); | 10356 "image/x-icon"); |
| 10358 MultipleDataChunkDelegate delegate; | 10357 MultipleDataChunkDelegate delegate; |
| 10359 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate); | 10358 Platform::current()->getURLLoaderMockFactory()->setLoaderDelegate(&delegate); |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10866 | 10865 |
| 10867 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); | 10866 EXPECT_TRUE(mainFrameClient.childClient().didCallFrameDetached()); |
| 10868 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); | 10867 EXPECT_TRUE(mainFrameClient.childClient().didCallDidStopLoading()); |
| 10869 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); | 10868 EXPECT_TRUE(mainFrameClient.childClient().didCallDidFinishDocumentLoad()); |
| 10870 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); | 10869 EXPECT_TRUE(mainFrameClient.childClient().didCallDidHandleOnloadEvents()); |
| 10871 | 10870 |
| 10872 webViewHelper.reset(); | 10871 webViewHelper.reset(); |
| 10873 } | 10872 } |
| 10874 | 10873 |
| 10875 } // namespace blink | 10874 } // namespace blink |
| OLD | NEW |