Changeset 180565 in webkit
- Timestamp:
- Feb 24, 2015 9:11:27 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r180553 r180565 1 2015-02-24 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 Crash loading local file with WebPageProxy::loadAlternateHTMLString 4 https://bugs.webkit.org/show_bug.cgi?id=141867 5 6 Reviewed by Anders Carlsson. 7 8 WebPageProxy::loadAlternateHTMLString needs to assume read access to unreachableURL as well 9 as baseURL, because unreachableURL will get added to the back/forward list, causing us to 10 crash later on when we notice the unexpected URL received in checkURLReceivedFromWebProcess. 11 12 * UIProcess/WebPageProxy.cpp: 13 (WebKit::WebPageProxy::loadAlternateHTMLString): 14 1 15 2015-02-24 Ryuan Choi <ryuan.choi@navercorp.com> 2 16 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r180517 r180565 920 920 921 921 m_process->assumeReadAccessToBaseURL(baseURL); 922 m_process->assumeReadAccessToBaseURL(unreachableURL); 922 923 m_process->send(Messages::WebPage::LoadAlternateHTMLString(htmlString, baseURL, unreachableURL, UserData(process().transformObjectsToHandles(userData).get())), m_pageID); 923 924 m_process->responsivenessTimer()->start(); -
trunk/Tools/ChangeLog
r180557 r180565 1 2015-02-24 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 Crash loading local file with WebPageProxy::loadAlternateHTMLString 4 https://bugs.webkit.org/show_bug.cgi?id=141867 5 6 Reviewed by Anders Carlsson. 7 8 * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: 9 (TestWebKitAPI::loadAlternateHTMLString): Split most of this test into a function so it can 10 be shared with the new test. 11 (TestWebKitAPI::TEST): Add a cross-platform test for this crash. 12 * TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp: Add a GTK+ test for this crash. 13 (testLoadAlternateHTMLForLocalPage): 14 (beforeAll): 15 1 16 2015-02-24 David Kilzer <ddkilzer@apple.com> 2 17 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
r177506 r180565 1 1 /* 2 2 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2015 Igalia S.L. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 45 46 } 46 47 47 TEST(WebKit2, LoadAlternateHTMLStringWithNonDirectoryURL)48 static void loadAlternateHTMLString(WKURLRef baseURL, WKURLRef unreachableURL) 48 49 { 49 50 WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate()); … … 57 58 WKPageSetPageLoaderClient(webView.page(), &loaderClient.base); 58 59 59 WKRetainPtr<WKURLRef> fileURL(AdoptWK, Util::createURLForResource("simple", "html"));60 60 WKRetainPtr<WKStringRef> alternateHTMLString(AdoptWK, WKStringCreateWithUTF8CString("<html><body><img src='icon.png'></body></html>")); 61 62 // Call WKPageLoadAlternateHTMLString() with fileURL which does not point to a directory 63 WKPageLoadAlternateHTMLString(webView.page(), alternateHTMLString.get(), fileURL.get(), fileURL.get()); 64 61 WKPageLoadAlternateHTMLString(webView.page(), alternateHTMLString.get(), baseURL, unreachableURL); 62 65 63 // If we can finish loading the html without resulting in an invalid message being sent from the WebProcess, this test passes. 66 64 Util::run(&didFinishLoad); 65 } 66 67 TEST(WebKit2, LoadAlternateHTMLStringWithNonDirectoryURL) 68 { 69 // Call WKPageLoadAlternateHTMLString() with fileURL which does not point to a directory. 70 WKRetainPtr<WKURLRef> fileURL(AdoptWK, Util::createURLForResource("simple", "html")); 71 loadAlternateHTMLString(fileURL.get(), fileURL.get()); 72 } 73 74 TEST(WebKit2, LoadAlternateHTMLStringWithEmptyBaseURL) 75 { 76 // Call WKPageLoadAlternateHTMLString() with empty baseURL to make sure this test works 77 // when baseURL does not grant read access to the unreachableURL. We use a separate test 78 // to ensure the previous test does not pollute the result. 79 WKRetainPtr<WKURLRef> unreachableURL(AdoptWK, Util::URLForNonExistentResource()); 80 loadAlternateHTMLString(nullptr, unreachableURL.get()); 67 81 } 68 82 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestLoaderClient.cpp
r176256 r180565 79 79 { 80 80 test->loadAlternateHTML("<html><body>Alternate page</body></html>", "http://error-page.foo/", 0); 81 test->waitUntilLoadFinished(); 82 assertNormalLoadHappened(test->m_loadEvents); 83 } 84 85 static void testLoadAlternateHTMLForLocalPage(LoadTrackingTest* test, gconstpointer) 86 { 87 test->loadAlternateHTML("<html><body>Alternate page</body></html>", "file:///not/actually/loaded.html", 0); 81 88 test->waitUntilLoadFinished(); 82 89 assertNormalLoadHappened(test->m_loadEvents); … … 478 485 LoadTrackingTest::add("WebKitWebView", "load-html", testLoadHtml); 479 486 LoadTrackingTest::add("WebKitWebView", "load-alternate-html", testLoadAlternateHTML); 487 LoadTrackingTest::add("WebKitWebView", "load-alternate-html-for-local-page", testLoadAlternateHTMLForLocalPage); 480 488 LoadTrackingTest::add("WebKitWebView", "load-plain-text", testLoadPlainText); 481 489 LoadTrackingTest::add("WebKitWebView", "load-bytes", testLoadBytes);
Note: See TracChangeset
for help on using the changeset viewer.