WebKit Bugzilla
Attachment 357744 Details for
Bug 192841
: [WPE][GTK] Purge use of g_assert() under TestWebKitAPI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192841-20181219175641.patch (text/plain), 466.24 KB, created by
Michael Catanzaro
on 2018-12-19 15:56:43 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2018-12-19 15:56:43 PST
Size:
466.24 KB
patch
obsolete
>Subversion Revision: 239396 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 29fb744c6d9cea64afaac21ff95a910e33bd7f4f..e2f025fe2de848919394d50e2761d182dda80528 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,354 @@ >+2018-12-19 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ [WPE][GTK] Purge use of g_assert() under TestWebKitAPI >+ https://bugs.webkit.org/show_bug.cgi?id=192841 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ There are separate g_assert_*() macros for use in tests, which we use inconsistently >+ currently. Use them always. We'll get nicer error messages now when tests fail, and the >+ assertions will now run during tests even if G_DISABLE_ASSERT is used when building. >+ >+ Unfortunately, some of these macros were written for C and do not work well in C++. Add a >+ new header, TestUtils.h, and redefine them there. We can't use TestMain.h anymore, because >+ this file includes UI process headers and so can't be used in the web process tests. >+ >+ * TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp: >+ * TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp: >+ (WebKitWebEditorTest::testSelectionChanged): >+ * TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp: >+ (WebKitFrameTest::testMainFrame): >+ (WebKitFrameTest::testURI): >+ (WebKitFrameTest::testJavaScriptContext): >+ (WebKitFrameTest::testJavaScriptValues): >+ * TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp: >+ (testWebViewAuthenticationRequest): >+ (testWebViewAuthenticationLoadCancelled): >+ (testWebViewAuthenticationFailure): >+ (testWebViewAuthenticationStorage): >+ (ProxyAuthenticationTest::ProxyAuthenticationTest): >+ (testWebViewAuthenticationProxy): >+ (testWebViewAuthenticationProxyHTTPS): >+ * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp: >+ (testAutomationSessionRequestSession): >+ * TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp: >+ (testBackForwardListNavigation): >+ (testWebKitWebViewSessionState): >+ (testWebKitWebViewSessionStateWithFormData): >+ * TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp: >+ (ConsoleMessageTest::consoleMessageReceivedCallback): >+ (testWebKitConsoleMessageConsoleAPI): >+ (testWebKitConsoleMessageJavaScriptException): >+ (testWebKitConsoleMessageNetworkError): >+ (testWebKitConsoleMessageSecurityError): >+ * TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp: >+ (testCookieManagerAcceptPolicy): >+ (testCookieManagerCookiesChanged): >+ (testCookieManagerPersistentStorage): >+ (testCookieManagerPersistentStorageDeleteAll): >+ (testCookieManagerEphemeral): >+ * TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp: >+ (testWebKitDOMElementAutoFill): >+ * TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp: >+ (downloadLocalFileSuccessfully): >+ (createFileAtDestination): >+ (testDownloadOverwriteDestinationDisallowed): >+ (testDownloadLocalFileError): >+ (testDownloadRemoteFile): >+ (testDownloadRemoteFileError): >+ (testWebViewDownloadURI): >+ (testPolicyResponseDownload): >+ (testPolicyResponseDownloadCancel): >+ (testDownloadMIMEType): >+ (contextMenuCallback): >+ (testContextMenuDownloadActions): >+ (testBlobDownload): >+ * TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp: >+ (testWebKitWebEditorSelectionChanged): >+ * TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp: >+ (testWebKitFrameMainFrame): >+ (testWebKitFrameURI): >+ (testWebKitFrameJavaScriptContext): >+ (testWebKitFrameJavaScriptValues): >+ * TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp: >+ (LoadStopTrackingTest::loadFailed): >+ (testWebViewTitle): >+ (testURIRequestHTTPHeaders): >+ (testURIRequestHTTPMethod): >+ (testURIResponseHTTPHeaders): >+ (testRedirectToDataURI): >+ * TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp: >+ (testProcessPerWebView): >+ (testWebProcessLimit): >+ * TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp: >+ (testWebViewResources): >+ (testWebResourceLoading): >+ (testWebResourceSuggestedFilename): >+ (testWebResourceGetData): >+ (testWebResourceGetDataError): >+ (testWebViewResourcesHistoryCache): >+ (testWebResourceSendRequest): >+ * TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp: >+ (testSSL): >+ (testInsecureContent): >+ (testTLSErrorsPolicy): >+ (testTLSErrorsRedirect): >+ (testTLSErrorsHTTPAuth): >+ (testLoadFailedWithTLSErrors): >+ (testSubresourceLoadFailedWithTLSErrors): >+ (httpsServerCallback): >+ * TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp: >+ (testWebViewCreateNavigationData): >+ (testWebViewJavaScriptDialogs): >+ (testWebViewWindowProperties): >+ (testWebViewMouseTarget): >+ (testWebViewFileChooserRequest): >+ (testWebViewColorChooserRequest): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp: >+ (testWebExtensionGetTitle): >+ (testDocumentLoadedSignal): >+ (testWebKitWebViewProcessCrashed): >+ (testWebExtensionWindowObjectCleared): >+ (testWebExtensionIsolatedWorld): >+ (permissionRequestCallback): >+ (didAssociateFormControlsCallback): >+ (testWebExtensionFormControlsAssociated): >+ (FormSubmissionTest::FormSubmissionTest): >+ (FormSubmissionTest::testFormSubmissionResult): >+ (testWebExtensionFormSubmissionSteps): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp: >+ (testNotInitialized): >+ (testClearDatabase): >+ (testPrivateBrowsing): >+ (testGetFavicon): >+ (testWebViewFavicon): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp: >+ (testFindControllerTextFound): >+ (testFindControllerTextNotFound): >+ (testFindControllerMatchCount): >+ (testFindControllerMaxMatchCount): >+ (testFindControllerNext): >+ (testFindControllerPrevious): >+ (testFindControllerCountedMatches): >+ (testFindControllerOptions): >+ (testFindControllerHide): >+ (testFindControllerInstance): >+ (testFindControllerGetters): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp: >+ (testNavigationPolicy): >+ (testResponsePolicy): >+ (testNewWindowPolicy): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp: >+ (testSecurityOriginBasicConstructor): >+ (testSecurityOriginURIConstructor): >+ (testSecurityOriginDefaultPort): >+ (testSecurityOriginFileURI): >+ (testOpaqueSecurityOrigin): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp: >+ (testWebKitSettings): >+ (testWebKitSettingsNewWithSettings): >+ (testWebKitSettingsUserAgent): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp: >+ (testWebViewNewWithUserContentManager): >+ (isStyleSheetInjectedForURLAtPath): >+ (isScriptInjectedForURLAtPath): >+ (testUserContentManagerInjectedStyleSheet): >+ (testUserContentManagerInjectedScript): >+ (UserScriptMessageTest::scriptMessageReceived): >+ (UserScriptMessageTest::waitUntilMessageReceived): >+ (UserScriptMessageTest::runJavaScriptFinished): >+ (testUserContentManagerScriptMessageReceived): >+ (testUserContentManagerScriptMessageInWorldReceived): >+ (testUserContentManagerScriptMessageFromDOMBindings): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp: >+ (testWebContextDefault): >+ (testWebContextEphemeral): >+ (testWebContextGetPlugins): >+ (testWebContextURIScheme): >+ (testWebContextSpellChecker): >+ (testWebContextLanguages): >+ (consoleMessageReceivedCallback): >+ (testWebContextSecurityFileXHR): >+ (ProxyTest::ProxyTest): >+ (testWebContextProxySettings): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp: >+ (testWebViewWebContext): >+ (testWebViewWebBackend): >+ (testWebViewEphemeral): >+ (testWebViewCustomCharset): >+ (testWebViewSettings): >+ (testWebViewRunJavaScript): >+ (testWebViewCanShowMIMEType): >+ (testWebViewSubmitForm): >+ (testWebViewSave): >+ (testWebViewPageVisibility): >+ (testWebViewSnapshot): >+ (testWebViewNotification): >+ (testWebViewNotificationInitialPermissionAllowed): >+ (testWebViewNotificationInitialPermissionDisallowed): >+ (testWebViewIsPlayingAudio): >+ * TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp: >+ (WebsiteDataTest::WebsiteDataTest): >+ (WebsiteDataTest::remove): >+ (WebsiteDataTest::clear): >+ (testWebsiteDataConfiguration): >+ (testWebsiteDataEphemeral): >+ (testWebsiteDataCache): >+ (testWebsiteDataStorage): >+ (testWebsiteDataDatabases): >+ (testWebsiteDataAppcache): >+ (testWebsiteDataCookies): >+ (testWebsiteDataDeviceIdHashSalt): >+ * TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp: >+ (emitDocumentLoaded): >+ (emitURIChanged): >+ (sendRequestCallback): >+ (contextMenuCallback): >+ (consoleMessageSentCallback): >+ (emitFormControlsAssociated): >+ (formControlsAssociatedCallback): >+ (emitFormSubmissionEvent): >+ (willSubmitFormCallback): >+ (windowObjectCleared): >+ (methodCallCallback): >+ (registerGResource): >+ (webkit_web_extension_initialize_with_user_data): >+ * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp: >+ (checkLeaks): >+ (WebProcessTest::create): >+ (runTest): >+ * TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h: >+ * TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp: >+ (AutocleanupsTest::testWebProcessAutocleanups): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp: >+ (WebKitDOMClientRectTest::testDivBoundingClientRectPosition): >+ (WebKitDOMClientRectTest::testDivClientRectsPositionAndLength): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMDOMWindowTest.cpp: >+ (WebKitDOMDOMWindowTest::testSignals): >+ (WebKitDOMDOMWindowTest::testDispatchEvent): >+ (WebKitDOMDOMWindowTest::testGetComputedStyle): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp: >+ (WebKitDOMNodeFilterTest::testTreeWalker): >+ (WebKitDOMNodeFilterTest::testNodeIterator): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp: >+ (WebKitDOMNodeTest::testHierarchyNavigation): >+ (WebKitDOMNodeTest::testInsertion): >+ (WebKitDOMNodeTest::testTagNamesNodeList): >+ (WebKitDOMNodeTest::testTagNamesHTMLCollection): >+ (WebKitDOMNodeTest::testDOMCache): >+ * TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp: >+ (WebKitDOMXPathNSResolverTest::evaluateFooChildTextAndCheckResult): >+ (WebKitDOMXPathNSResolverTest::testXPathNSResolverNative): >+ (WebKitDOMXPathNSResolverTest::testXPathNSResolverCustom): >+ * TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp: >+ (testUIProcessAutocleanups): >+ (testWebProcessAutocleanups): >+ * TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp: >+ (testContextMenuPopulateMenu): >+ (testContextMenuDismissed): >+ * TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp: >+ (testWebKitDOMClientRectDivBoundingClientRectPosition): >+ (testWebKitDOMClientRectDivClientRectsPositionAndLength): >+ * TestWebKitAPI/Tests/WebKitGtk/TestDOMDOMWindow.cpp: >+ (testWebKitDOMDOMWindowSignals): >+ (testWebKitDOMDOMWindowDispatchEvent): >+ (testWebKitDOMDOMWindowGetComputedStyle): >+ * TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp: >+ (testWebKitDOMNodeHierarchyNavigation): >+ (testWebKitDOMNodeInsertion): >+ (testWebKitDOMNodeTagNamesNodeList): >+ (testWebKitDOMNodeTagNamesHTMLCollection): >+ (testWebKitDOMObjectCache): >+ * TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp: >+ (testWebKitDOMNodeFilterTreeWalker): >+ (testWebKitDOMNodeFilterNodeIterator): >+ * TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp: >+ (testWebKitDOMXPathNSResolverNative): >+ (testWebKitDOMXPathNSResolverCustom): >+ * TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp: >+ (testInspectorDefault): >+ (testInspectorManualAttachDetach): >+ (testInspectorCustomContainerDestroyed): >+ * TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp: >+ (startTestServer): >+ (testInspectorServerPageList): >+ * TestWebKitAPI/Tests/WebKitGtk/TestOptionMenu.cpp: >+ (OptionMenuTest::showOptionMenuCallback): >+ (OptionMenuTest::menuCloseCallback): >+ (OptionMenuTest::close): >+ (OptionMenuTest::activateItem): >+ (OptionMenuTest::selectItem): >+ (testOptionMenuSimple): >+ (testOptionMenuGroups): >+ (testOptionMenuActivate): >+ (testOptionMenuSelect): >+ * TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp: >+ (testPrintOperationPrintSettings): >+ (webViewPrintCallback): >+ (testPrintOperationPrint): >+ (testPrintCustomWidget): >+ * TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp: >+ (checkAtspiAccessible): >+ (testAtspiBasicHierarchy): >+ * TestWebKitAPI/Tests/WebKitGtk/TestWebKitVersion.cpp: >+ (testWebKitCheckVersion): >+ * TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp: >+ (testWebViewEditorCutCopyPasteNonEditable): >+ (testWebViewEditorCutCopyPasteEditable): >+ (testWebViewEditorSelectAllNonEditable): >+ (testWebViewEditorSelectAllEditable): >+ (loadContentsAndTryToCutSelection): >+ (testWebViewEditorNonEditable): >+ (testWebViewEditorEditable): >+ (testWebViewEditorEditorStateTypingAttributes): >+ (testWebViewEditorInsertImage): >+ (testWebViewEditorCreateLink): >+ * TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp: >+ (loadChangedCallback): >+ (loadFailedCallback): >+ (loadFailedWithTLSErrorsCallback): >+ (LoadTrackingTest::LoadTrackingTest): >+ * TestWebKitAPI/glib/WebKitGLib/TestMain.cpp: >+ (registerGResource): >+ (removeNonEmptyDirectory): >+ * TestWebKitAPI/glib/WebKitGLib/TestMain.h: >+ (Test::adoptView): >+ (Test::~Test): >+ * TestWebKitAPI/glib/WebKitGLib/TestUtils.h: Added. >+ * TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp: >+ (WebKitTestBus::getOrCreateConnection): >+ (WebKitTestBus::createProxy): >+ * TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp: >+ (WebKitTestServer::getWebSocketURIForPath const): >+ * TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp: >+ (WebViewTest::initializeWebView): >+ (WebViewTest::loadURI): >+ (WebViewTest::loadHtml): >+ (WebViewTest::loadPlainText): >+ (WebViewTest::loadBytes): >+ (WebViewTest::loadRequest): >+ (WebViewTest::loadAlternateHTML): >+ (WebViewTest::goBack): >+ (WebViewTest::goForward): >+ (WebViewTest::goToBackForwardListItem): >+ (resourceGetDataCallback): >+ (WebViewTest::mainResourceData): >+ (WebViewTest::javascriptResultToCString): >+ (WebViewTest::javascriptResultToNumber): >+ (WebViewTest::javascriptResultToBoolean): >+ (WebViewTest::javascriptResultIsNull): >+ (WebViewTest::javascriptResultIsUndefined): >+ (onSnapshotReady): >+ (WebViewTest::runWebProcessTest): >+ * TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp: >+ (WebViewTest::platformInitializeWebView): >+ (WebViewTest::showInWindow): >+ (WebViewTest::showInWindowAndWaitUntilMapped): >+ (WebViewTest::mouseMoveTo): >+ (WebViewTest::emitPopupMenuSignal): >+ (WebViewTest::keyStroke): >+ (WebViewTest::doMouseButtonEvent): >+ > 2018-12-19 Megan Gardner <megan_gardner@apple.com> > > Allow clients to set the navigator platform >diff --git a/Tools/TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp b/Tools/TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp >index f7fa6aacdc33d20b717bc6be2d551b205b0f07a4..7e372c332409f637cf33c4840aa1c00228c61a28 100644 >--- a/Tools/TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp >+++ b/Tools/TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp >@@ -655,7 +655,7 @@ static void testJSCEvaluateInObject() > > GRefPtr<JSCValue> rootFoo = adoptGRef(jsc_value_object_get_property(globalObject.get(), "foo")); > checker.watch(rootFoo.get()); >- g_assert(jsc_value_is_function(rootFoo.get())); >+ g_assert_true(jsc_value_is_function(rootFoo.get())); > result = adoptGRef(jsc_value_function_call(rootFoo.get(), G_TYPE_NONE)); > checker.watch(result.get()); > g_assert_true(jsc_value_is_number(result.get())); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >index c3d17e39a34273fc4e14d45c14f107afbbe95f5a..5f763e4bbcddb93f1d2d461ae91aa3a993d009d1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/EditorTest.cpp >@@ -36,12 +36,12 @@ private: > bool selectionChanged = false; > > WebKitWebEditor* editor = webkit_web_page_get_editor(page); >- g_assert(WEBKIT_IS_WEB_EDITOR(editor)); >+ g_assert_true(WEBKIT_IS_WEB_EDITOR(editor)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(editor)); > g_signal_connect_swapped(editor, "selection-changed", G_CALLBACK(selectionChangedCallback), &selectionChanged); > > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context(webkit_web_page_get_main_frame(page))); >- g_assert(JSC_IS_CONTEXT(jsContext.get())); >+ g_assert_true(JSC_IS_CONTEXT(jsContext.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsContext.get())); > > static const char* steps[] = { >@@ -56,10 +56,10 @@ private: > GRefPtr<JSCValue> result; > unsigned i = 0; > while (const char* command = steps[i++]) { >- g_assert(!selectionChanged); >+ g_assert_false(selectionChanged); > result = adoptGRef(jsc_context_evaluate(jsContext.get(), command, -1)); >- g_assert(JSC_IS_VALUE(result.get())); >- g_assert(selectionChanged); >+ g_assert_true(JSC_IS_VALUE(result.get())); >+ g_assert_true(selectionChanged); > selectionChanged = false; > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >index 461b1cb22fcba95cd7f8c76fc7fd3b47a56db474..a50ac6584b788b3b79c3b65a595550c55458a469 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/FrameTest.cpp >@@ -31,8 +31,8 @@ private: > bool testMainFrame(WebKitWebPage* page) > { > WebKitFrame* frame = webkit_web_page_get_main_frame(page); >- g_assert(WEBKIT_IS_FRAME(frame)); >- g_assert(webkit_frame_is_main_frame(frame)); >+ g_assert_true(WEBKIT_IS_FRAME(frame)); >+ g_assert_true(webkit_frame_is_main_frame(frame)); > > return true; > } >@@ -40,7 +40,7 @@ private: > bool testURI(WebKitWebPage* page) > { > WebKitFrame* frame = webkit_web_page_get_main_frame(page); >- g_assert(WEBKIT_IS_FRAME(frame)); >+ g_assert_true(WEBKIT_IS_FRAME(frame)); > g_assert_cmpstr(webkit_web_page_get_uri(page), ==, webkit_frame_get_uri(frame)); > > return true; >@@ -49,15 +49,15 @@ private: > bool testJavaScriptContext(WebKitWebPage* page) > { > WebKitFrame* frame = webkit_web_page_get_main_frame(page); >- g_assert(WEBKIT_IS_FRAME(frame)); >+ g_assert_true(WEBKIT_IS_FRAME(frame)); > #if PLATFORM(GTK) > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; >- g_assert(webkit_frame_get_javascript_global_context(frame)); >+ g_assert_nonnull(webkit_frame_get_javascript_global_context(frame)); > G_GNUC_END_IGNORE_DEPRECATIONS; > #endif > > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context(frame)); >- g_assert(JSC_IS_CONTEXT(jsContext.get())); >+ g_assert_true(JSC_IS_CONTEXT(jsContext.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsContext.get())); > > return true; >@@ -66,65 +66,65 @@ private: > bool testJavaScriptValues(WebKitWebPage* page) > { > WebKitFrame* frame = webkit_web_page_get_main_frame(page); >- g_assert(WEBKIT_IS_FRAME(frame)); >+ g_assert_true(WEBKIT_IS_FRAME(frame)); > > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context(frame)); >- g_assert(JSC_IS_CONTEXT(jsContext.get())); >+ g_assert_true(JSC_IS_CONTEXT(jsContext.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsContext.get())); > > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > GRefPtr<JSCValue> jsDocument = adoptGRef(webkit_frame_get_js_value_for_dom_object(frame, WEBKIT_DOM_OBJECT(document))); >- g_assert(JSC_IS_VALUE(jsDocument.get())); >+ g_assert_true(JSC_IS_VALUE(jsDocument.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsDocument.get())); >- g_assert(jsc_value_get_context(jsDocument.get()) == jsContext.get()); >+ g_assert_cmphex(jsc_value_get_context(jsDocument.get()), ==, jsContext.get()); > > GRefPtr<JSCValue> value = adoptGRef(jsc_context_get_value(jsContext.get(), "document")); >- g_assert(value.get() == jsDocument.get()); >+ g_assert_cmphex(value.get(), ==, jsDocument.get()); > > #if PLATFORM(GTK) > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > WebKitDOMElement* p = webkit_dom_document_get_element_by_id(document, "paragraph"); > G_GNUC_END_IGNORE_DEPRECATIONS; >- g_assert(WEBKIT_DOM_IS_ELEMENT(p)); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(p)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p)); > > GRefPtr<JSCValue> jsP = adoptGRef(webkit_frame_get_js_value_for_dom_object(frame, WEBKIT_DOM_OBJECT(p))); > #else > GRefPtr<JSCValue> jsP = adoptGRef(jsc_value_object_invoke_method(jsDocument.get(), "getElementById", G_TYPE_STRING, "paragraph", G_TYPE_NONE)); > #endif >- g_assert(JSC_IS_VALUE(jsP.get())); >+ g_assert_true(JSC_IS_VALUE(jsP.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsP.get())); >- g_assert(jsc_value_is_object(jsP.get())); >- g_assert(jsc_value_get_context(jsP.get()) == jsContext.get()); >+ g_assert_true(jsc_value_is_object(jsP.get())); >+ g_assert_cmphex(jsc_value_get_context(jsP.get()), ==, jsContext.get()); > > value = adoptGRef(jsc_context_evaluate(jsContext.get(), "document.getElementById('paragraph')", -1)); >- g_assert(value.get() == jsP.get()); >+ g_assert_cmphex(value.get(), ==, jsP.get()); > #if PLATFORM(GTK) > value = adoptGRef(jsc_value_object_invoke_method(jsDocument.get(), "getElementById", G_TYPE_STRING, "paragraph", G_TYPE_NONE)); >- g_assert(value.get() == jsP.get()); >+ g_assert_cmphex(value.get(), ==, jsP.get()); > #endif > > value = adoptGRef(jsc_value_object_get_property(jsP.get(), "innerText")); >- g_assert(JSC_IS_VALUE(value.get())); >+ g_assert_true(JSC_IS_VALUE(value.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(value.get())); >- g_assert(jsc_value_is_string(value.get())); >+ g_assert_true(jsc_value_is_string(value.get())); > GUniquePtr<char> strValue(jsc_value_to_string(value.get())); > g_assert_cmpstr(strValue.get(), ==, "This is a test"); > > GRefPtr<JSCValue> jsImage = adoptGRef(jsc_value_object_invoke_method(jsDocument.get(), "getElementById", G_TYPE_STRING, "image", G_TYPE_NONE)); >- g_assert(JSC_IS_VALUE(jsImage.get())); >+ g_assert_true(JSC_IS_VALUE(jsImage.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(jsImage.get())); >- g_assert(jsc_value_is_object(jsImage.get())); >+ g_assert_true(jsc_value_is_object(jsImage.get())); > > WebKitDOMNode* image = webkit_dom_node_for_js_value(jsImage.get()); >- g_assert(WEBKIT_DOM_IS_ELEMENT(image)); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(image)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(image)); > #if PLATFORM(GTK) > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; >- g_assert(webkit_dom_document_get_element_by_id(document, "image") == WEBKIT_DOM_ELEMENT(image)); >+ g_assert_cmphex(webkit_dom_document_get_element_by_id(document, "image"), ==, WEBKIT_DOM_ELEMENT(image)); > G_GNUC_END_IGNORE_DEPRECATIONS; > #endif > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp >index 56dedf7042fe3da131a0c7a2cb3a2db448cc828b..d6cc2fb247e562066977610b25679b7ed1dcc8ba 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAuthentication.cpp >@@ -103,9 +103,9 @@ static void testWebViewAuthenticationRequest(AuthenticationTest* test, gconstpoi > g_assert_cmpstr(webkit_authentication_request_get_host(request), ==, soup_uri_get_host(kServer->baseURI())); > g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, soup_uri_get_port(kServer->baseURI())); > g_assert_cmpstr(webkit_authentication_request_get_realm(request), ==, "my realm"); >- g_assert(webkit_authentication_request_get_scheme(request) == WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >- g_assert(!webkit_authentication_request_is_for_proxy(request)); >- g_assert(!webkit_authentication_request_is_retry(request)); >+ g_assert_cmpint(webkit_authentication_request_get_scheme(request), ==, WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >+ g_assert_false(webkit_authentication_request_is_for_proxy(request)); >+ g_assert_false(webkit_authentication_request_is_retry(request)); > } > > static void testWebViewAuthenticationCancel(AuthenticationTest* test, gconstpointer) >@@ -132,7 +132,7 @@ static void testWebViewAuthenticationLoadCancelled(AuthenticationTest* test, gco > webkit_web_view_stop_loading(test->m_webView); > // Expect empty page. > test->waitUntilLoadFinished(); >- g_assert(test->authenticationCancelledReceived); >+ g_assert_true(test->authenticationCancelledReceived); > > g_assert_cmpint(test->m_loadEvents.size(), ==, 3); > g_assert_cmpint(test->m_loadEvents[0], ==, LoadTrackingTest::ProvisionalLoadStarted); >@@ -147,13 +147,13 @@ static void testWebViewAuthenticationFailure(AuthenticationTest* test, gconstpoi > // Test authentication failures. > test->loadURI(kServer->getURIForPath("/auth-test.html").data()); > WebKitAuthenticationRequest* request = test->waitForAuthenticationRequest(); >- g_assert(!webkit_authentication_request_is_retry(request)); >+ g_assert_false(webkit_authentication_request_is_retry(request)); > WebKitCredential* credential = webkit_credential_new(authTestUsername, "wrongpassword", WEBKIT_CREDENTIAL_PERSISTENCE_NONE); > webkit_authentication_request_authenticate(request, credential); > webkit_credential_free(credential); > // Expect a second authentication request. > request = test->waitForAuthenticationRequest(); >- g_assert(webkit_authentication_request_is_retry(request)); >+ g_assert_true(webkit_authentication_request_is_retry(request)); > // Test second failure. > credential = webkit_credential_new(authTestUsername, "wrongpassword2", WEBKIT_CREDENTIAL_PERSISTENCE_NONE); > webkit_authentication_request_authenticate(request, credential); >@@ -194,8 +194,8 @@ static void testWebViewAuthenticationStorage(AuthenticationTest* test, gconstpoi > G_GNUC_END_IGNORE_DEPRECATIONS; > test->loadURI(kServer->getURIForPath("/auth-test.html").data()); > WebKitAuthenticationRequest* request = test->waitForAuthenticationRequest(); >- g_assert(!webkit_authentication_request_get_proposed_credential(request)); >- g_assert(!webkit_authentication_request_can_save_credentials(request)); >+ g_assert_null(webkit_authentication_request_get_proposed_credential(request)); >+ g_assert_false(webkit_authentication_request_can_save_credentials(request)); > > // If WebKit has been compiled with libsecret, and private browsing is disabled > // then check that credentials can be saved. >@@ -205,8 +205,8 @@ static void testWebViewAuthenticationStorage(AuthenticationTest* test, gconstpoi > G_GNUC_END_IGNORE_DEPRECATIONS; > test->loadURI(kServer->getURIForPath("/auth-test.html").data()); > request = test->waitForAuthenticationRequest(); >- g_assert(!webkit_authentication_request_get_proposed_credential(request)); >- g_assert(webkit_authentication_request_can_save_credentials(request)); >+ g_assert_null(webkit_authentication_request_get_proposed_credential(request)); >+ g_assert_true(webkit_authentication_request_can_save_credentials(request)); > #endif > } > #endif >@@ -357,7 +357,7 @@ public: > ProxyAuthenticationTest() > { > m_proxyServer.run(serverCallback); >- g_assert(m_proxyServer.baseURI()); >+ g_assert_nonnull(m_proxyServer.baseURI()); > gProxyServerPort = soup_uri_get_port(m_proxyServer.baseURI()); > GUniquePtr<char> proxyURI(soup_uri_to_string(m_proxyServer.baseURI(), FALSE)); > WebKitNetworkProxySettings* settings = webkit_network_proxy_settings_new(proxyURI.get(), nullptr); >@@ -387,9 +387,9 @@ static void testWebViewAuthenticationProxy(ProxyAuthenticationTest* test, gconst > g_assert_cmpstr(webkit_authentication_request_get_host(request), ==, soup_uri_get_host(kServer->baseURI())); > g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, soup_uri_get_port(kServer->baseURI())); > g_assert_cmpstr(webkit_authentication_request_get_realm(request), ==, "Proxy realm"); >- g_assert(webkit_authentication_request_get_scheme(request) == WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >- g_assert(webkit_authentication_request_is_for_proxy(request)); >- g_assert(!webkit_authentication_request_is_retry(request)); >+ g_assert_cmpint(webkit_authentication_request_get_scheme(request), ==, WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >+ g_assert_true(webkit_authentication_request_is_for_proxy(request)); >+ g_assert_false(webkit_authentication_request_is_retry(request)); > } > > static void testWebViewAuthenticationProxyHTTPS(ProxyAuthenticationTest* test, gconstpointer) >@@ -403,9 +403,9 @@ static void testWebViewAuthenticationProxyHTTPS(ProxyAuthenticationTest* test, g > g_assert_cmpstr(webkit_authentication_request_get_host(request), ==, soup_uri_get_host(httpsServer->baseURI())); > g_assert_cmpuint(webkit_authentication_request_get_port(request), ==, soup_uri_get_port(httpsServer->baseURI())); > g_assert_cmpstr(webkit_authentication_request_get_realm(request), ==, "Proxy realm"); >- g_assert(webkit_authentication_request_get_scheme(request) == WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >- g_assert(webkit_authentication_request_is_for_proxy(request)); >- g_assert(!webkit_authentication_request_is_retry(request)); >+ g_assert_cmpint(webkit_authentication_request_get_scheme(request), ==, WEBKIT_AUTHENTICATION_SCHEME_HTTP_BASIC); >+ g_assert_true(webkit_authentication_request_is_for_proxy(request)); >+ g_assert_false(webkit_authentication_request_is_retry(request)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp >index 2562cb48dfae18f5c90240da37fec16476b231e0..89b983580df1a81f2f85a10e93a13dc4251013dc 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp >@@ -117,7 +117,7 @@ public: > > void setConnection(GRefPtr<GDBusConnection>&& connection) > { >- g_assert(G_IS_DBUS_CONNECTION(connection.get())); >+ g_assert_true(G_IS_DBUS_CONNECTION(connection.get())); > m_connection = WTFMove(connection); > registerDBusObject(); > g_main_loop_quit(m_mainLoop.get()); >@@ -135,8 +135,8 @@ public: > > void receivedMessage(guint64 connectionID, guint64 targetID, const char* message) > { >- g_assert(connectionID == m_connectionID); >- g_assert(targetID == m_target.id); >+ g_assert_cmpuint(connectionID, ==, m_connectionID); >+ g_assert_cmpuint(targetID, ==, m_target.id); > m_message = message; > g_main_loop_quit(m_mainLoop.get()); > } >@@ -170,19 +170,19 @@ public: > { > m_session = session; > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_session)); >- g_assert(!webkit_automation_session_get_application_info(session)); >+ g_assert_null(webkit_automation_session_get_application_info(session)); > WebKitApplicationInfo* info = webkit_application_info_new(); > webkit_application_info_set_name(info, "AutomationTestBrowser"); > webkit_application_info_set_version(info, WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION); > webkit_automation_session_set_application_info(session, info); > webkit_application_info_unref(info); >- g_assert(webkit_automation_session_get_application_info(session) == info); >+ g_assert_cmphex(webkit_automation_session_get_application_info(session), ==, info); > } > > static void automationStartedCallback(WebKitWebContext* webContext, WebKitAutomationSession* session, AutomationTest* test) > { >- g_assert(webContext == test->m_webContext.get()); >- g_assert(WEBKIT_IS_AUTOMATION_SESSION(session)); >+ g_assert_cmphex(webContext, ==, test->m_webContext.get()); >+ g_assert_true(WEBKIT_IS_AUTOMATION_SESSION(session)); > test->automationStarted(session); > } > >@@ -208,7 +208,7 @@ public: > return; > > GRefPtr<GVariant> capabilities = adoptGRef(g_dbus_connection_call_finish(G_DBUS_CONNECTION(source), result, nullptr)); >- g_assert(capabilities.get()); >+ g_assert_nonnull(capabilities.get()); > const char* browserName; > const char* browserVersion; > g_variant_get(capabilities.get(), "(&s&s)", &browserName, &browserVersion); >@@ -234,11 +234,11 @@ public: > { > if (m_target.isPaired) > return; >- g_assert(m_target.id); >+ g_assert_cmpuint(m_target.id, !=, 0); > g_dbus_connection_call(m_connection.get(), nullptr, "/org/webkit/Inspector", "org.webkit.Inspector", > "Setup", g_variant_new("(tt)", m_connectionID, m_target.id), nullptr, G_DBUS_CALL_FLAGS_NO_AUTO_START, -1, nullptr, nullptr, nullptr); > g_main_loop_run(m_mainLoop.get()); >- g_assert(m_target.isPaired); >+ g_assert_true(m_target.isPaired); > } > > bool createTopLevelBrowsingContext(WebKitWebView* webView) >@@ -251,8 +251,8 @@ public: > sendCommandToBackend("createBrowsingContext"); > g_main_loop_run(m_mainLoop.get()); > g_signal_handler_disconnect(m_session, signalID); >- g_assert(m_createWebViewWasCalled); >- g_assert(!m_message.isNull()); >+ g_assert_true(m_createWebViewWasCalled); >+ g_assert_false(m_message.isNull()); > m_webViewForAutomation = nullptr; > > if (strstr(m_message.data(), "The remote session failed to create a new browsing context")) >@@ -277,33 +277,33 @@ static void testAutomationSessionRequestSession(AutomationTest* test, gconstpoin > { > String sessionID = createCanonicalUUIDString(); > // WebKitAutomationSession::automation-started is never emitted if automation is not enabled. >- g_assert(!webkit_web_context_is_automation_allowed(test->m_webContext.get())); >+ g_assert_false(webkit_web_context_is_automation_allowed(test->m_webContext.get())); > auto* session = test->requestSession(sessionID.utf8().data()); >- g_assert(!session); >+ g_assert_null(session); > > webkit_web_context_set_automation_allowed(test->m_webContext.get(), TRUE); >- g_assert(webkit_web_context_is_automation_allowed(test->m_webContext.get())); >+ g_assert_true(webkit_web_context_is_automation_allowed(test->m_webContext.get())); > > // There can't be more than one context with automation enabled > GRefPtr<WebKitWebContext> otherContext = adoptGRef(webkit_web_context_new()); > test->removeLogFatalFlag(G_LOG_LEVEL_WARNING); > webkit_web_context_set_automation_allowed(otherContext.get(), TRUE); > test->addLogFatalFlag(G_LOG_LEVEL_WARNING); >- g_assert(!webkit_web_context_is_automation_allowed(otherContext.get())); >+ g_assert_false(webkit_web_context_is_automation_allowed(otherContext.get())); > > session = test->requestSession(sessionID.utf8().data()); > g_assert_cmpstr(webkit_automation_session_get_id(session), ==, sessionID.utf8().data()); > g_assert_cmpuint(test->m_target.id, >, 0); > ASSERT_CMP_CSTRING(test->m_target.name, ==, sessionID.utf8()); >- g_assert(!test->m_target.isPaired); >+ g_assert_false(test->m_target.isPaired); > > // Will fail to create a browsing context when not creating a web view (or not handling the signal). >- g_assert(!test->createTopLevelBrowsingContext(nullptr)); >+ g_assert_false(test->createTopLevelBrowsingContext(nullptr)); > > // Will also fail if the web view is not controlled by automation. > auto webView = Test::adoptView(Test::createWebView(test->m_webContext.get())); >- g_assert(!webkit_web_view_is_controlled_by_automation(webView.get())); >- g_assert(!test->createTopLevelBrowsingContext(webView.get())); >+ g_assert_false(webkit_web_view_is_controlled_by_automation(webView.get())); >+ g_assert_false(test->createTopLevelBrowsingContext(webView.get())); > > // And will work with a proper web view. > webView = Test::adoptView(g_object_new(WEBKIT_TYPE_WEB_VIEW, >@@ -313,8 +313,8 @@ static void testAutomationSessionRequestSession(AutomationTest* test, gconstpoin > "web-context", test->m_webContext.get(), > "is-controlled-by-automation", TRUE, > nullptr)); >- g_assert(webkit_web_view_is_controlled_by_automation(webView.get())); >- g_assert(test->createTopLevelBrowsingContext(webView.get())); >+ g_assert_true(webkit_web_view_is_controlled_by_automation(webView.get())); >+ g_assert_true(test->createTopLevelBrowsingContext(webView.get())); > > webkit_web_context_set_automation_allowed(test->m_webContext.get(), FALSE); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp >index 0363e4d657cb25d652ed1d281a1cc87b549232fb..e828e764969f1ee55e5acdc42afea7e668a1d415 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp >@@ -66,7 +66,7 @@ public: > > static void checkItem(WebKitBackForwardListItem* item, const char* title, const char* uri, const char* originalURI) > { >- g_assert(item); >+ g_assert_nonnull(item); > g_assert_cmpstr(webkit_back_forward_list_item_get_uri(item), ==, uri); > g_assert_cmpstr(webkit_back_forward_list_item_get_title(item), == , title); > g_assert_cmpstr(webkit_back_forward_list_item_get_original_uri(item), ==, originalURI); >@@ -74,21 +74,21 @@ public: > > static void checkItemIndex(WebKitBackForwardList* list) > { >- g_assert(webkit_back_forward_list_get_nth_item(list, -1) == webkit_back_forward_list_get_back_item(list)); >- g_assert(webkit_back_forward_list_get_nth_item(list, 0) == webkit_back_forward_list_get_current_item(list)); >- g_assert(webkit_back_forward_list_get_nth_item(list, 1) == webkit_back_forward_list_get_forward_item(list)); >+ g_assert_cmphex(webkit_back_forward_list_get_nth_item(list, -1), ==, webkit_back_forward_list_get_back_item(list)); >+ g_assert_cmphex(webkit_back_forward_list_get_nth_item(list, 0), ==, webkit_back_forward_list_get_current_item(list)); >+ g_assert_cmphex(webkit_back_forward_list_get_nth_item(list, 1), ==, webkit_back_forward_list_get_forward_item(list)); > } > > static void checkList(WebKitBackForwardList* list, unsigned type, WebKitBackForwardListItem** items, unsigned nItems) > { > GList* listItems = type == BackForwardListTest::Backward ? webkit_back_forward_list_get_back_list(list) : > webkit_back_forward_list_get_forward_list(list); >- g_assert(listItems); >+ g_assert_nonnull(listItems); > > unsigned i = 0; > for (GList* listItem = listItems; listItem; listItem = g_list_next(listItem), i++) { > g_assert_cmpuint(i, <, nItems); >- g_assert(listItem->data == items[i]); >+ g_assert_cmphex(listItem->data, ==, items[i]); > } > g_list_free(listItems); > } >@@ -98,21 +98,21 @@ public: > test->m_hasChanged = true; > > if (test->m_changedFlags & BackForwardListTest::AddedItem) { >- g_assert(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(addedItem)); >+ g_assert_true(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(addedItem)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(addedItem)); > } else >- g_assert(!addedItem); >+ g_assert_null(addedItem); > > if (test->m_changedFlags & BackForwardListTest::RemovedItems) { >- g_assert(removedItems); >+ g_assert_nonnull(removedItems); > for (GList* iter = removedItems; iter; iter = iter->next) { >- g_assert(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(iter->data)); >+ g_assert_true(WEBKIT_IS_BACK_FORWARD_LIST_ITEM(iter->data)); > if (test->m_expectedRemovedItems) >- g_assert(g_list_find(test->m_expectedRemovedItems, iter->data)); >+ g_assert_nonnull(g_list_find(test->m_expectedRemovedItems, iter->data)); > } > > } else >- g_assert(!removedItems); >+ g_assert_null(removedItems); > } > > BackForwardListTest() >@@ -134,7 +134,7 @@ public: > { > m_hasChanged = false; > WebViewTest::waitUntilLoadFinished(); >- g_assert(m_hasChanged); >+ g_assert_true(m_hasChanged); > } > > void waitUntilLoadFinishedAndCheckRemovedItems(GList* removedItems) >@@ -154,66 +154,66 @@ static void testBackForwardListNavigation(BackForwardListTest* test, gconstpoint > { > WebKitBackForwardListItem* items[1]; > >- g_assert(!webkit_web_view_can_go_back(test->m_webView)); >- g_assert(!webkit_web_view_can_go_forward(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_back(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_forward(test->m_webView)); > > g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, 0); >- g_assert(!webkit_back_forward_list_get_current_item(test->m_list)); >- g_assert(!webkit_back_forward_list_get_back_item(test->m_list)); >- g_assert(!webkit_back_forward_list_get_forward_item(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_current_item(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_back_item(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_item(test->m_list)); > BackForwardListTest::checkItemIndex(test->m_list); >- g_assert(!webkit_back_forward_list_get_back_list(test->m_list)); >- g_assert(!webkit_back_forward_list_get_forward_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_back_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_list(test->m_list)); > > CString uriPage1 = kServer->getURIForPath("/Page1"); > test->m_changedFlags = BackForwardListTest::CurrentItem | BackForwardListTest::AddedItem; > test->loadURI(uriPage1.data()); > test->waitUntilLoadFinished(); > >- g_assert(!webkit_web_view_can_go_back(test->m_webView)); >- g_assert(!webkit_web_view_can_go_forward(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_back(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_forward(test->m_webView)); > > g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, 1); > WebKitBackForwardListItem* itemPage1 = webkit_back_forward_list_get_current_item(test->m_list); > BackForwardListTest::checkItem(itemPage1, "Page1", uriPage1.data(), uriPage1.data()); >- g_assert(!webkit_back_forward_list_get_back_item(test->m_list)); >- g_assert(!webkit_back_forward_list_get_forward_item(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_back_item(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_item(test->m_list)); > BackForwardListTest::checkItemIndex(test->m_list); >- g_assert(!webkit_back_forward_list_get_back_list(test->m_list)); >- g_assert(!webkit_back_forward_list_get_forward_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_back_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_list(test->m_list)); > > CString uriPage2 = kServer->getURIForPath("/Page2"); > test->m_changedFlags = BackForwardListTest::CurrentItem | BackForwardListTest::AddedItem; > test->loadURI(uriPage2.data()); > test->waitUntilLoadFinished(); > >- g_assert(webkit_web_view_can_go_back(test->m_webView)); >- g_assert(!webkit_web_view_can_go_forward(test->m_webView)); >+ g_assert_true(webkit_web_view_can_go_back(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_forward(test->m_webView)); > > g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, 2); > WebKitBackForwardListItem* itemPage2 = webkit_back_forward_list_get_current_item(test->m_list); > BackForwardListTest::checkItem(itemPage2, "Page2", uriPage2.data(), uriPage2.data()); >- g_assert(webkit_back_forward_list_get_back_item(test->m_list) == itemPage1); >- g_assert(!webkit_back_forward_list_get_forward_item(test->m_list)); >+ g_assert_cmphex(webkit_back_forward_list_get_back_item(test->m_list), ==, itemPage1); >+ g_assert_null(webkit_back_forward_list_get_forward_item(test->m_list)); > BackForwardListTest::checkItemIndex(test->m_list); > items[0] = itemPage1; > BackForwardListTest::checkList(test->m_list, BackForwardListTest::Backward, items, 1); >- g_assert(!webkit_back_forward_list_get_forward_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_list(test->m_list)); > > test->m_changedFlags = BackForwardListTest::CurrentItem; > test->goBack(); > test->waitUntilLoadFinished(); > >- g_assert(!webkit_web_view_can_go_back(test->m_webView)); >- g_assert(webkit_web_view_can_go_forward(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_back(test->m_webView)); >+ g_assert_true(webkit_web_view_can_go_forward(test->m_webView)); > > g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, 2); >- g_assert(itemPage1 == webkit_back_forward_list_get_current_item(test->m_list)); >+ g_assert_cmphex(itemPage1, ==, webkit_back_forward_list_get_current_item(test->m_list)); > BackForwardListTest::checkItem(webkit_back_forward_list_get_current_item(test->m_list), "Page1", uriPage1.data(), uriPage1.data()); >- g_assert(!webkit_back_forward_list_get_back_item(test->m_list)); >- g_assert(webkit_back_forward_list_get_forward_item(test->m_list) == itemPage2); >+ g_assert_null(webkit_back_forward_list_get_back_item(test->m_list)); >+ g_assert_cmphex(webkit_back_forward_list_get_forward_item(test->m_list), ==, itemPage2); > BackForwardListTest::checkItemIndex(test->m_list); >- g_assert(!webkit_back_forward_list_get_back_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_back_list(test->m_list)); > items[0] = itemPage2; > BackForwardListTest::checkList(test->m_list, BackForwardListTest::Forward, items, 1); > >@@ -221,24 +221,24 @@ static void testBackForwardListNavigation(BackForwardListTest* test, gconstpoint > test->goForward(); > test->waitUntilLoadFinished(); > >- g_assert(webkit_web_view_can_go_back(test->m_webView)); >- g_assert(!webkit_web_view_can_go_forward(test->m_webView)); >+ g_assert_true(webkit_web_view_can_go_back(test->m_webView)); >+ g_assert_false(webkit_web_view_can_go_forward(test->m_webView)); > > g_assert_cmpuint(webkit_back_forward_list_get_length(test->m_list), ==, 2); >- g_assert(itemPage2 == webkit_back_forward_list_get_current_item(test->m_list)); >+ g_assert_cmphex(itemPage2, ==, webkit_back_forward_list_get_current_item(test->m_list)); > BackForwardListTest::checkItem(webkit_back_forward_list_get_current_item(test->m_list), "Page2", uriPage2.data(), uriPage2.data()); >- g_assert(webkit_back_forward_list_get_back_item(test->m_list) == itemPage1); >- g_assert(!webkit_back_forward_list_get_forward_item(test->m_list)); >+ g_assert_cmphex(webkit_back_forward_list_get_back_item(test->m_list), ==, itemPage1); >+ g_assert_null(webkit_back_forward_list_get_forward_item(test->m_list)); > BackForwardListTest::checkItemIndex(test->m_list); > items[0] = itemPage1; > BackForwardListTest::checkList(test->m_list, BackForwardListTest::Backward, items, 1); >- g_assert(!webkit_back_forward_list_get_forward_list(test->m_list)); >+ g_assert_null(webkit_back_forward_list_get_forward_list(test->m_list)); > > test->m_changedFlags = BackForwardListTest::CurrentItem; > test->goToBackForwardListItem(itemPage1); > test->waitUntilLoadFinished(); > >- g_assert(itemPage1 == webkit_back_forward_list_get_current_item(test->m_list)); >+ g_assert_cmphex(itemPage1, ==, webkit_back_forward_list_get_current_item(test->m_list)); > } > > static void testBackForwardListLimitAndCache(BackForwardListTest* test, gconstpointer) >@@ -265,16 +265,16 @@ static void testBackForwardListLimitAndCache(BackForwardListTest* test, gconstpo > static void testWebKitWebViewSessionState(BackForwardListTest* test, gconstpointer) > { > WebKitWebViewSessionState* state = webkit_web_view_get_session_state(test->m_webView); >- g_assert(state); >+ g_assert_nonnull(state); > auto view = Test::adoptView(Test::createWebView()); > WebKitBackForwardList* bfList = webkit_web_view_get_back_forward_list(view.get()); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); > webkit_web_view_restore_session_state(view.get(), state); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); > GRefPtr<GBytes> data = adoptGRef(webkit_web_view_session_state_serialize(state)); >- g_assert(data); >+ g_assert_nonnull(data); > state = webkit_web_view_session_state_new(data.get()); >- g_assert(state); >+ g_assert_nonnull(state); > view = Test::adoptView(Test::createWebView()); > bfList = webkit_web_view_get_back_forward_list(view.get()); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); >@@ -302,7 +302,7 @@ static void testWebKitWebViewSessionState(BackForwardListTest* test, gconstpoint > test->waitUntilLoadFinished(); > > state = webkit_web_view_get_session_state(test->m_webView); >- g_assert(state); >+ g_assert_nonnull(state); > > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); > webkit_web_view_restore_session_state(view.get(), state); >@@ -313,10 +313,10 @@ static void testWebKitWebViewSessionState(BackForwardListTest* test, gconstpoint > BackForwardListTest::checkItem(webkit_back_forward_list_get_nth_item(bfList, 1), "Page3", uriPage3.data(), uriPage3.data()); > > data = adoptGRef(webkit_web_view_session_state_serialize(state)); >- g_assert(data); >+ g_assert_nonnull(data); > webkit_web_view_session_state_unref(state); > state = webkit_web_view_session_state_new(data.get()); >- g_assert(state); >+ g_assert_nonnull(state); > > view = Test::adoptView(Test::createWebView()); > bfList = webkit_web_view_get_back_forward_list(view.get()); >@@ -331,7 +331,7 @@ static void testWebKitWebViewSessionState(BackForwardListTest* test, gconstpoint > > static const char* invalidSessionData = "invalid session data"; > data = adoptGRef(g_bytes_new_static(invalidSessionData, strlen(invalidSessionData))); >- g_assert(!webkit_web_view_session_state_new(data.get())); >+ g_assert_null(webkit_web_view_session_state_new(data.get())); > } > > static void testWebKitWebViewSessionStateWithFormData(BackForwardListTest* test, gconstpointer) >@@ -346,16 +346,16 @@ static void testWebKitWebViewSessionStateWithFormData(BackForwardListTest* test, > test->waitUntilLoadFinished(); > > WebKitWebViewSessionState* state = webkit_web_view_get_session_state(test->m_webView); >- g_assert(state); >+ g_assert_nonnull(state); > auto view = Test::adoptView(Test::createWebView()); > WebKitBackForwardList* bfList = webkit_web_view_get_back_forward_list(view.get()); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); > webkit_web_view_restore_session_state(view.get(), state); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 2); > GRefPtr<GBytes> data = adoptGRef(webkit_web_view_session_state_serialize(state)); >- g_assert(data); >+ g_assert_nonnull(data); > state = webkit_web_view_session_state_new(data.get()); >- g_assert(state); >+ g_assert_nonnull(state); > view = Test::adoptView(Test::createWebView()); > bfList = webkit_web_view_get_back_forward_list(view.get()); > g_assert_cmpuint(webkit_back_forward_list_get_length(bfList), ==, 0); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp >index 8681493c17cc8d751fe7dbb9cf51a66c075960ef..878a1c64de1d92e255e5278a24129bb42c0a51b1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp >@@ -47,10 +47,10 @@ public: > > static void consoleMessageReceivedCallback(WebKitUserContentManager*, WebKitJavascriptResult* message, ConsoleMessageTest* test) > { >- g_assert(message); >+ g_assert_nonnull(message); > GUniquePtr<char> messageString(WebViewTest::javascriptResultToCString(message)); > GRefPtr<GVariant> variant = g_variant_parse(G_VARIANT_TYPE("(uusus)"), messageString.get(), nullptr, nullptr, nullptr); >- g_assert(variant.get()); >+ g_assert_nonnull(variant.get()); > > unsigned source, level, lineNumber; > const char* messageText; >@@ -86,31 +86,31 @@ static void testWebKitConsoleMessageConsoleAPI(ConsoleMessageTest* test, gconstp > ConsoleMessageTest::ConsoleMessage referenceMessage = { ConsoleMessageTest::MessageSource::ConsoleAPI, ConsoleMessageTest::MessageLevel::Log, "Log Console Message", 1, "http://foo.com/bar" }; > test->loadHtml("<html><body onload='console.log(\"Log Console Message\");'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > > referenceMessage.level = ConsoleMessageTest::MessageLevel::Info; > referenceMessage.message = "Info Console Message"; > test->loadHtml("<html><body onload='console.info(\"Info Console Message\");'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > > referenceMessage.level = ConsoleMessageTest::MessageLevel::Warning; > referenceMessage.message = "Warning Console Message"; > test->loadHtml("<html><body onload='console.warn(\"Warning Console Message\");'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > > referenceMessage.level = ConsoleMessageTest::MessageLevel::Error; > referenceMessage.message = "Error Console Message"; > test->loadHtml("<html><body onload='console.error(\"Error Console Message\");'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > > referenceMessage.level = ConsoleMessageTest::MessageLevel::Debug; > referenceMessage.message = "Debug Console Message"; > test->loadHtml("<html><body onload='console.debug(\"Debug Console Message\");'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > } > > static void testWebKitConsoleMessageJavaScriptException(ConsoleMessageTest* test, gconstpointer) >@@ -119,7 +119,7 @@ static void testWebKitConsoleMessageJavaScriptException(ConsoleMessageTest* test > "ReferenceError: Can't find variable: foo", 1, "http://foo.com/bar" }; > test->loadHtml("<html><body onload='foo()'></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > } > > static void testWebKitConsoleMessageNetworkError(ConsoleMessageTest* test, gconstpointer) >@@ -128,7 +128,7 @@ static void testWebKitConsoleMessageNetworkError(ConsoleMessageTest* test, gcons > "Failed to load resource: The resource at â/org/webkit/glib/tests/not-found.cssâ does not exist", 0, "resource:///org/webkit/glib/tests/not-found.css" }; > test->loadHtml("<html><head><link rel='stylesheet' href='not-found.css' type='text/css'></head><body></body></html>", "resource:///org/webkit/glib/tests/"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > } > > static void testWebKitConsoleMessageSecurityError(ConsoleMessageTest* test, gconstpointer) >@@ -137,7 +137,7 @@ static void testWebKitConsoleMessageSecurityError(ConsoleMessageTest* test, gcon > "Not allowed to load local resource: file:///foo/bar/source.png", 1, "http://foo.com/bar" }; > test->loadHtml("<html><body><img src=\"file:///foo/bar/source.png\"/></body></html>", "http://foo.com/bar"); > test->waitUntilConsoleMessageReceived(); >- g_assert(test->m_consoleMessage == referenceMessage); >+ g_assert_true(test->m_consoleMessage == referenceMessage); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >index b0514524f72591f6cb502911031b7bfa8a3afa07..10dfa6fc8ebb55e6c7adc66088ddd221cb93c10a 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestCookieManager.cpp >@@ -58,7 +58,7 @@ public: > : WebViewTest() > , m_cookieManager(webkit_web_context_get_cookie_manager(webkit_web_view_get_context(m_webView))) > { >- g_assert(webkit_website_data_manager_get_cookie_manager(webkit_web_context_get_website_data_manager(webkit_web_view_get_context(m_webView))) == m_cookieManager); >+ g_assert_cmphex(webkit_website_data_manager_get_cookie_manager(webkit_web_context_get_website_data_manager(webkit_web_view_get_context(m_webView))), ==, m_cookieManager); > g_signal_connect(m_cookieManager, "changed", G_CALLBACK(cookiesChangedCallback), this); > } > >@@ -98,7 +98,7 @@ public: > { > GUniqueOutPtr<GError> error; > WebKitCookieAcceptPolicy policy = webkit_cookie_manager_get_accept_policy_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > > CookieManagerTest* test = static_cast<CookieManagerTest*>(userData); > test->m_acceptPolicy = policy; >@@ -118,8 +118,8 @@ public: > { > GUniqueOutPtr<GError> error; > bool added = webkit_cookie_manager_add_cookie_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); >- g_assert(!error.get()); >- g_assert(added); >+ g_assert_no_error(error.get()); >+ g_assert_true(added); > > CookieManagerTest* test = static_cast<CookieManagerTest*>(userData); > g_main_loop_quit(test->m_mainLoop); >@@ -135,7 +135,7 @@ public: > { > GUniqueOutPtr<GError> error; > GList* cookies = webkit_cookie_manager_get_cookies_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > > CookieManagerTest* test = static_cast<CookieManagerTest*>(userData); > test->m_cookies = cookies; >@@ -156,8 +156,8 @@ public: > { > GUniqueOutPtr<GError> error; > bool deleted = webkit_cookie_manager_delete_cookie_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); >- g_assert(!error.get()); >- g_assert(deleted); >+ g_assert_no_error(error.get()); >+ g_assert_true(deleted); > > CookieManagerTest* test = static_cast<CookieManagerTest*>(userData); > g_main_loop_quit(test->m_mainLoop); >@@ -180,7 +180,7 @@ public: > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > char** domains = webkit_cookie_manager_get_domains_with_cookies_finish(WEBKIT_COOKIE_MANAGER(object), result, &error.outPtr()); > G_GNUC_END_IGNORE_DEPRECATIONS; >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > > CookieManagerTest* test = static_cast<CookieManagerTest*>(userData); > test->m_domains = domains; >@@ -252,7 +252,7 @@ static void testCookieManagerAcceptPolicy(CookieManagerTest* test, gconstpointer > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); > char** domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 1); > g_assert_cmpstr(domains[0], ==, kFirstPartyDomain); > test->deleteAllCookies(); >@@ -262,10 +262,10 @@ static void testCookieManagerAcceptPolicy(CookieManagerTest* test, gconstpointer > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 2); >- g_assert(test->hasDomain(kFirstPartyDomain)); >- g_assert(test->hasDomain(kThirdPartyDomain)); >+ g_assert_true(test->hasDomain(kFirstPartyDomain)); >+ g_assert_true(test->hasDomain(kThirdPartyDomain)); > test->deleteAllCookies(); > > test->setAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_NEVER); >@@ -273,7 +273,7 @@ static void testCookieManagerAcceptPolicy(CookieManagerTest* test, gconstpointer > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > } > >@@ -520,19 +520,19 @@ static void testCookieManagerDeleteCookies(CookieManagerTest* test, gconstpointe > > static void testCookieManagerCookiesChanged(CookieManagerTest* test, gconstpointer) > { >- g_assert(!test->m_cookiesChanged); >+ g_assert_false(test->m_cookiesChanged); > test->setAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS); > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_cookiesChanged); >+ g_assert_true(test->m_cookiesChanged); > > test->deleteCookiesForDomain(kFirstPartyDomain); > test->waitUntilCookiesChanged(); >- g_assert(test->m_cookiesChanged); >+ g_assert_true(test->m_cookiesChanged); > > test->deleteAllCookies(); > test->waitUntilCookiesChanged(); >- g_assert(test->m_cookiesChanged); >+ g_assert_true(test->m_cookiesChanged); > } > > static void testCookieManagerPersistentStorage(CookieManagerTest* test, gconstpointer) >@@ -542,34 +542,34 @@ static void testCookieManagerPersistentStorage(CookieManagerTest* test, gconstpo > // Text storage using a new file. > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); > char** domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_cookiesChanged); >+ g_assert_true(test->m_cookiesChanged); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 2); > > > // SQLite storage using a new file. > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > > test->loadURI(kServer->getURIForPath("/index.html").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_cookiesChanged); >+ g_assert_true(test->m_cookiesChanged); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 2); > > // Text storage using an existing file. > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 2); > test->deleteAllCookies(); > g_assert_cmpint(g_strv_length(test->getDomains()), ==, 0); >@@ -577,7 +577,7 @@ static void testCookieManagerPersistentStorage(CookieManagerTest* test, gconstpo > // SQLite storage with an existing file. > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE); > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 2); > test->deleteAllCookies(); > g_assert_cmpint(g_strv_length(test->getDomains()), ==, 0); >@@ -591,7 +591,7 @@ static void testCookieManagerPersistentStorageDeleteAll(CookieManagerTest* test, > time_t expires = time(nullptr) + 60; > GUniquePtr<char> cookiesFileContents(g_strdup_printf(cookiesFileFormat, expires, expires)); > GUniquePtr<char> cookiesFile(g_build_filename(Test::dataDirectory(), "cookies.txt", nullptr)); >- g_assert(g_file_set_contents(cookiesFile.get(), cookiesFileContents.get(), -1, nullptr)); >+ g_assert_true(g_file_set_contents(cookiesFile.get(), cookiesFileContents.get(), -1, nullptr)); > > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); > test->deleteAllCookies(); >@@ -602,9 +602,9 @@ static void testCookieManagerPersistentStorageDeleteAll(CookieManagerTest* test, > test->m_cookiesChanged = false; > test->loadURI(kServer->getURIForPath("/no-cookies.html").data()); > test->waitUntilLoadFinished(); >- g_assert(!test->m_cookiesChanged); >+ g_assert_false(test->m_cookiesChanged); > char** domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > } > >@@ -621,7 +621,7 @@ static void testCookieManagerEphemeral(CookieManagerTest* test, gconstpointer) > test->setAcceptPolicy(WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS); > test->setPersistentStorage(WEBKIT_COOKIE_PERSISTENT_STORAGE_TEXT); > char** domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > > auto webView = Test::adoptView(g_object_new(WEBKIT_TYPE_WEB_VIEW, >@@ -631,30 +631,30 @@ static void testCookieManagerEphemeral(CookieManagerTest* test, gconstpointer) > "web-context", webkit_web_view_get_context(test->m_webView), > "is-ephemeral", TRUE, > nullptr)); >- g_assert(webkit_web_view_is_ephemeral(webView.get())); >- g_assert(!webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); >+ g_assert_true(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_false(webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); > > g_signal_connect(webView.get(), "load-changed", G_CALLBACK(ephemeralViewloadChanged), test); > webkit_web_view_load_uri(webView.get(), kServer->getURIForPath("/index.html").data()); > g_main_loop_run(test->m_mainLoop); > > domains = test->getDomains(); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains), ==, 0); > > auto* viewDataManager = webkit_web_view_get_website_data_manager(webView.get()); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(viewDataManager)); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(viewDataManager)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(viewDataManager)); >- g_assert(viewDataManager != webkit_web_context_get_website_data_manager(webkit_web_view_get_context(test->m_webView))); >+ g_assert_cmphex(viewDataManager, !=, webkit_web_context_get_website_data_manager(webkit_web_view_get_context(test->m_webView))); > auto* cookieManager = webkit_website_data_manager_get_cookie_manager(viewDataManager); >- g_assert(WEBKIT_IS_COOKIE_MANAGER(cookieManager)); >+ g_assert_true(WEBKIT_IS_COOKIE_MANAGER(cookieManager)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(cookieManager)); >- g_assert(cookieManager != test->m_cookieManager); >+ g_assert_cmphex(cookieManager, !=, test->m_cookieManager); > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > webkit_cookie_manager_get_domains_with_cookies(cookieManager, nullptr, [](GObject* object, GAsyncResult* result, gpointer userData) { > auto* test = static_cast<CookieManagerTest*>(userData); > GUniquePtr<char*> domains(webkit_cookie_manager_get_domains_with_cookies_finish(WEBKIT_COOKIE_MANAGER(object), result, nullptr)); >- g_assert(domains); >+ g_assert_nonnull(domains); > g_assert_cmpint(g_strv_length(domains.get()), ==, 1); > g_assert_cmpstr(domains.get()[0], ==, kFirstPartyDomain); > test->quitMainLoop(); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp >index 3d28046bf2454ddcc7d88642148b778eb28b6cff..0b7bfda32bcdd781aee2e9cfe111801d017e55bf 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp >@@ -24,7 +24,7 @@ > static void testWebKitDOMElementAutoFill(WebViewTest* test, gconstpointer) > { > static const gchar* testHTML = "<html><body><form action='#'><input id='auto-fill'></input></form></body></html>"; >- g_assert(test->runWebProcessTest("WebKitDOMElement", "auto-fill", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMElement", "auto-fill", testHTML)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp >index 53fd42aeadab0b4099030f800aacf9628cb93bbf..e93392f2b5dffe6b93aaebbc9a78d6d39d34efe0 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestDownloads.cpp >@@ -44,16 +44,16 @@ public: > > static void receivedResponseCallback(WebKitDownload* download, GParamSpec*, DownloadTest* test) > { >- g_assert(webkit_download_get_response(download)); >+ g_assert_nonnull(webkit_download_get_response(download)); > test->receivedResponse(download); > } > > static void createdDestinationCallback(WebKitDownload* download, const gchar* destination, DownloadTest* test) > { >- g_assert(webkit_download_get_destination(download)); >+ g_assert_nonnull(webkit_download_get_destination(download)); > g_assert_cmpstr(webkit_download_get_destination(download), ==, destination); > GRefPtr<GFile> file = adoptGRef(g_file_new_for_uri(destination)); >- g_assert(g_file_query_exists(file.get(), nullptr)); >+ g_assert_true(g_file_query_exists(file.get(), nullptr)); > test->createdDestination(download, destination); > } > >@@ -69,13 +69,13 @@ public: > > static void failedCallback(WebKitDownload* download, GError* error, DownloadTest* test) > { >- g_assert(error); >+ g_assert_nonnull(error); > > const char* destinationURI = webkit_download_get_destination(download); > if (destinationURI) { > GUniquePtr<char> tempFileURI(g_strconcat(destinationURI, ".wkdownload", nullptr)); > GRefPtr<GFile> tempFile = adoptGRef(g_file_new_for_uri(tempFileURI.get())); >- g_assert(!g_file_query_exists(tempFile.get(), nullptr)); >+ g_assert_false(g_file_query_exists(tempFile.get(), nullptr)); > } > > test->failed(download, error); >@@ -83,14 +83,14 @@ public: > > static gboolean decideDestinationCallback(WebKitDownload* download, const gchar* suggestedFilename, DownloadTest* test) > { >- g_assert(suggestedFilename); >+ g_assert_nonnull(suggestedFilename); > test->decideDestination(download, suggestedFilename); > return TRUE; > } > > static void downloadStartedCallback(WebKitWebContext* context, WebKitDownload* download, DownloadTest* test) > { >- g_assert(webkit_download_get_request(download)); >+ g_assert_nonnull(webkit_download_get_request(download)); > test->started(download); > g_signal_connect(download, "notify::response", G_CALLBACK(receivedResponseCallback), test); > g_signal_connect(download, "created-destination", G_CALLBACK(createdDestinationCallback), test); >@@ -162,12 +162,12 @@ public: > GRefPtr<WebKitDownload> download = adoptGRef(webkit_web_context_download_uri(m_webContext.get(), requestURI.data())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(download.get())); > >- g_assert(!webkit_download_get_allow_overwrite(download.get())); >+ g_assert_false(webkit_download_get_allow_overwrite(download.get())); > webkit_download_set_allow_overwrite(download.get(), m_allowOverwrite); >- g_assert(webkit_download_get_allow_overwrite(download.get()) == m_allowOverwrite); >+ g_assert_cmpint(webkit_download_get_allow_overwrite(download.get()), ==, m_allowOverwrite); > > WebKitURIRequest* request = webkit_download_get_request(download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, requestURI); > > g_main_loop_run(m_mainLoop); >@@ -199,7 +199,7 @@ static GRefPtr<WebKitDownload> downloadLocalFileSuccessfully(DownloadTest* test, > GRefPtr<GFileInfo> sourceInfo = adoptGRef(g_file_query_info(source.get(), G_FILE_ATTRIBUTE_STANDARD_SIZE, static_cast<GFileQueryInfoFlags>(0), 0, 0)); > GUniquePtr<char> sourceURI(g_file_get_uri(source.get())); > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes(sourceURI.get()); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 5); >@@ -210,11 +210,11 @@ static GRefPtr<WebKitDownload> downloadLocalFileSuccessfully(DownloadTest* test, > g_assert_cmpint(events[4], ==, DownloadTest::Finished); > > WebKitURIRequest* request = webkit_download_get_request(download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > g_assert_cmpstr(webkit_uri_request_get_uri(request), ==, sourceURI.get()); > > g_assert_cmpint(test->m_downloadSize, ==, g_file_info_get_size(sourceInfo.get())); >- g_assert(webkit_download_get_destination(download.get())); >+ g_assert_nonnull(webkit_download_get_destination(download.get())); > g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), ==, 1); > > return download; >@@ -233,8 +233,8 @@ static void createFileAtDestination(const char* filename) > GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path.get())); > GUniqueOutPtr<GError> error; > g_file_create(file.get(), G_FILE_CREATE_NONE, nullptr, &error.outPtr()); >- g_assert(!error); >- g_assert(g_file_query_exists(file.get(), nullptr)); >+ g_assert_no_error(error.get()); >+ g_assert_true(g_file_query_exists(file.get(), nullptr)); > } > > static void testDownloadOverwriteDestinationAllowed(DownloadTest* test, gconstpointer) >@@ -278,7 +278,7 @@ public: > > void failed(WebKitDownload* download, GError* error) > { >- g_assert(g_error_matches(error, WEBKIT_DOWNLOAD_ERROR, expectedErrorToWebKitDownloadError(m_expectedError))); >+ g_assert_error(error, WEBKIT_DOWNLOAD_ERROR, expectedErrorToWebKitDownloadError(m_expectedError)); > DownloadTest::failed(download, error); > } > >@@ -320,7 +320,7 @@ static void testDownloadOverwriteDestinationDisallowed(DownloadErrorTest* test, > GRefPtr<GFile> source = adoptGRef(g_file_new_for_path(sourcePath.get())); > GUniquePtr<char> sourceURI(g_file_get_uri(source.get())); > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes(sourceURI.get()); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 4); >@@ -337,7 +337,7 @@ static void testDownloadLocalFileError(DownloadErrorTest* test, gconstpointer) > { > test->m_expectedError = DownloadErrorTest::NetworkError; > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes("file:///foo/bar"); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 3); >@@ -352,7 +352,7 @@ static void testDownloadLocalFileError(DownloadErrorTest* test, gconstpointer) > GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path.get())); > GUniquePtr<char> uri(g_file_get_uri(file.get())); > download = test->downloadURIAndWaitUntilFinishes(uri.get()); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, DownloadTest::Started); >@@ -365,7 +365,7 @@ static void testDownloadLocalFileError(DownloadErrorTest* test, gconstpointer) > > test->m_expectedError = DownloadErrorTest::DownloadCancelled; > download = test->downloadURIAndWaitUntilFinishes(uri.get()); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, DownloadTest::Started); >@@ -438,7 +438,7 @@ static void serverCallback(SoupServer* server, SoupMessage* message, const char* > static void testDownloadRemoteFile(DownloadTest* test, gconstpointer) > { > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes(kServer->getURIForPath("/test.pdf")); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 5); >@@ -450,13 +450,13 @@ static void testDownloadRemoteFile(DownloadTest* test, gconstpointer) > events.clear(); > > WebKitURIRequest* request = webkit_download_get_request(download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, kServer->getURIForPath("/test.pdf")); > > auto headers = webkit_uri_request_get_http_headers(request); > g_assert_nonnull(soup_message_headers_get_one(headers, "User-Agent")); > >- g_assert(webkit_download_get_destination(download.get())); >+ g_assert_nonnull(webkit_download_get_destination(download.get())); > g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), ==, 1); > GUniquePtr<char> expectedFilename(g_strdup_printf("%s.pdf", kServerSuggestedFilename)); > test->checkDestinationAndDeleteFile(download.get(), expectedFilename.get()); >@@ -466,7 +466,7 @@ static void testDownloadRemoteFileError(DownloadErrorTest* test, gconstpointer) > { > test->m_expectedError = DownloadErrorTest::NetworkError; > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes(kServer->getURIForPath("/foo")); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 4); >@@ -481,7 +481,7 @@ static void testDownloadRemoteFileError(DownloadErrorTest* test, gconstpointer) > > test->m_expectedError = DownloadErrorTest::InvalidDestination; > download = test->downloadURIAndWaitUntilFinishes(kServer->getURIForPath("/test.pdf")); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, DownloadTest::Started); >@@ -494,7 +494,7 @@ static void testDownloadRemoteFileError(DownloadErrorTest* test, gconstpointer) > > test->m_expectedError = DownloadErrorTest::DownloadCancelled; > download = test->downloadURIAndWaitUntilFinishes(kServer->getURIForPath("/cancel-after-destination")); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, DownloadTest::Started); >@@ -506,7 +506,7 @@ static void testDownloadRemoteFileError(DownloadErrorTest* test, gconstpointer) > // Check the intermediate file is deleted when the download is cancelled. > GUniquePtr<char> intermediateURI(g_strdup_printf("%s.wkdownload", webkit_download_get_destination(download.get()))); > GRefPtr<GFile> intermediateFile = adoptGRef(g_file_new_for_uri(intermediateURI.get())); >- g_assert(!g_file_query_exists(intermediateFile.get(), nullptr)); >+ g_assert_false(g_file_query_exists(intermediateFile.get(), nullptr)); > } > > class WebViewDownloadTest: public WebViewTest { >@@ -536,7 +536,7 @@ public: > { > m_download = 0; > g_main_loop_run(m_mainLoop); >- g_assert(m_download.get()); >+ g_assert_nonnull(m_download.get()); > } > > static gboolean downloadDecideDestinationCallback(WebKitDownload* download, const gchar* suggestedFilename, WebViewDownloadTest* test) >@@ -568,10 +568,10 @@ static void testWebViewDownloadURI(WebViewDownloadTest* test, gconstpointer) > GRefPtr<WebKitDownload> download = adoptGRef(webkit_web_view_download_uri(test->m_webView, kServer->getURIForPath("/test.pdf").data())); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(download.get())); > test->waitUntilDownloadStarted(); >- g_assert(test->m_webView == webkit_download_get_web_view(download.get())); >+ g_assert_cmphex(test->m_webView, ==, webkit_download_get_web_view(download.get())); > > WebKitURIRequest* request = webkit_download_get_request(download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, kServer->getURIForPath("/test.pdf")); > > auto headers = webkit_uri_request_get_http_headers(request); >@@ -625,10 +625,10 @@ static void testPolicyResponseDownload(PolicyResponseDownloadTest* test, gconstp > test->waitUntilDownloadStarted(); > > WebKitURIRequest* request = webkit_download_get_request(test->m_download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, requestURI); > >- g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get())); >+ g_assert_cmphex(test->m_webView, ==, webkit_download_get_web_view(test->m_download.get())); > > auto headers = webkit_uri_request_get_http_headers(request); > g_assert_nonnull(soup_message_headers_get_one(headers, "User-Agent")); >@@ -647,10 +647,10 @@ static void testPolicyResponseDownloadCancel(PolicyResponseDownloadTest* test, g > test->waitUntilDownloadStarted(); > > WebKitURIRequest* request = webkit_download_get_request(test->m_download.get()); >- g_assert(request); >+ g_assert_nonnull(request); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, requestURI); > >- g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get())); >+ g_assert_cmphex(test->m_webView, ==, webkit_download_get_web_view(test->m_download.get())); > > auto headers = webkit_uri_request_get_http_headers(request); > g_assert_nonnull(soup_message_headers_get_one(headers, "User-Agent")); >@@ -660,7 +660,7 @@ static void testPolicyResponseDownloadCancel(PolicyResponseDownloadTest* test, g > static void testDownloadMIMEType(DownloadTest* test, gconstpointer) > { > GRefPtr<WebKitDownload> download = test->downloadURIAndWaitUntilFinishes(kServer->getURIForPath("/unknown")); >- g_assert(!webkit_download_get_web_view(download.get())); >+ g_assert_null(webkit_download_get_web_view(download.get())); > > Vector<DownloadTest::DownloadEvent>& events = test->m_downloadEvents; > g_assert_cmpint(events.size(), ==, 5); >@@ -682,7 +682,7 @@ static void testDownloadMIMEType(DownloadTest* test, gconstpointer) > WEBKIT_IS_URI_RESPONSE(response); > g_assert_cmpstr(webkit_uri_response_get_mime_type(response), ==, "application/pdf"); > >- g_assert(webkit_download_get_destination(download.get())); >+ g_assert_nonnull(webkit_download_get_destination(download.get())); > g_assert_cmpfloat(webkit_download_get_estimated_progress(download.get()), ==, 1); > GUniquePtr<char> expectedFilename(g_strdup_printf("%s.pdf", kServerSuggestedFilename)); > test->checkDestinationAndDeleteFile(download.get(), expectedFilename.get()); >@@ -691,19 +691,19 @@ static void testDownloadMIMEType(DownloadTest* test, gconstpointer) > #if PLATFORM(GTK) > static gboolean contextMenuCallback(WebKitWebView* webView, WebKitContextMenu* contextMenu, GdkEvent*, WebKitHitTestResult* hitTestResult, WebViewDownloadTest* test) > { >- g_assert(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_true(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_link(hitTestResult)); > GList* items = webkit_context_menu_get_items(contextMenu); > GRefPtr<WebKitContextMenuItem> contextMenuItem; > for (GList* l = items; l; l = g_list_next(l)) { >- g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(l->data)); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU_ITEM(l->data)); > auto* item = WEBKIT_CONTEXT_MENU_ITEM(l->data); > if (webkit_context_menu_item_get_stock_action(item) == WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_LINK_TO_DISK) { > contextMenuItem = item; > break; > } > } >- g_assert(contextMenuItem.get()); >+ g_assert_nonnull(contextMenuItem.get()); > webkit_context_menu_remove_all(contextMenu); > webkit_context_menu_append(contextMenu, contextMenuItem.get()); > test->quitMainLoop(); >@@ -736,7 +736,7 @@ static void testContextMenuDownloadActions(WebViewDownloadTest* test, gconstpoin > }, test); > test->waitUntilDownloadStarted(); > >- g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get())); >+ g_assert_cmphex(test->m_webView, ==, webkit_download_get_web_view(test->m_download.get())); > > WebKitURIRequest* request = webkit_download_get_request(test->m_download.get()); > WEBKIT_IS_URI_REQUEST(request); >@@ -775,7 +775,7 @@ static void testBlobDownload(WebViewDownloadTest* test, gconstpointer) > }, test); > test->waitUntilDownloadStarted(); > >- g_assert(test->m_webView == webkit_download_get_web_view(test->m_download.get())); >+ g_assert_cmphex(test->m_webView, ==, webkit_download_get_web_view(test->m_download.get())); > test->waitUntilDownloadFinished(); > > GRefPtr<GFile> downloadFile = adoptGRef(g_file_new_for_uri(webkit_download_get_destination(test->m_download.get()))); >@@ -783,7 +783,7 @@ static void testBlobDownload(WebViewDownloadTest* test, gconstpointer) > GUniquePtr<char> downloadPath(g_file_get_path(downloadFile.get())); > GUniqueOutPtr<char> downloadContents; > gsize downloadContentsLength; >- g_assert(g_file_get_contents(downloadPath.get(), &downloadContents.outPtr(), &downloadContentsLength, nullptr)); >+ g_assert_true(g_file_get_contents(downloadPath.get(), &downloadContents.outPtr(), &downloadContentsLength, nullptr)); > g_assert_cmpint(g_file_info_get_size(downloadFileInfo.get()), ==, downloadContentsLength); > g_assert_cmpstr(downloadContents.get(), ==, "Hello world"); > g_file_delete(downloadFile.get(), nullptr, nullptr); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp >index 58be53e3bed4eecdfed86680b8a2df344898007d..3f6ab245bd9af8da35999614141f0f3537b597d1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestEditor.cpp >@@ -24,7 +24,7 @@ > static void testWebKitWebEditorSelectionChanged(WebViewTest* test, gconstpointer) > { > static const gchar* testHTML = "<html><body>All work and no play make Jack a dull boy.</body></html>"; >- g_assert(test->runWebProcessTest("WebKitWebEditor", "selection-changed", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitWebEditor", "selection-changed", testHTML)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp >index 6f33729b1801957896d2432203d1ed6b0141e494..f6d297f2e49e8b42ee383b182ed4d8b84751515f 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestFrame.cpp >@@ -23,23 +23,23 @@ > > static void testWebKitFrameMainFrame(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitFrame", "main-frame")); >+ g_assert_true(test->runWebProcessTest("WebKitFrame", "main-frame")); > } > > static void testWebKitFrameURI(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitFrame", "uri")); >+ g_assert_true(test->runWebProcessTest("WebKitFrame", "uri")); > } > > static void testWebKitFrameJavaScriptContext(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitFrame", "javascript-context")); >+ g_assert_true(test->runWebProcessTest("WebKitFrame", "javascript-context")); > } > > static void testWebKitFrameJavaScriptValues(WebViewTest* test, gconstpointer) > { > static const char* testHTML = "<html><body><p id='paragraph'>This is a test</p><img id='image' src='foo.png'></body></html>"; >- g_assert(test->runWebProcessTest("WebKitFrame", "javascript-values", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitFrame", "javascript-values", testHTML)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp >index bf372a560a08926267cd646bc8c31af8727c5f6d..c67af1684ffcdf23859bc475d0905d2af98a4bad 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestLoaderClient.cpp >@@ -135,7 +135,7 @@ public: > } > virtual void loadFailed(const gchar* failingURI, GError* error) > { >- g_assert(g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)); >+ g_assert_error(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED); > LoadTrackingTest::loadFailed(failingURI, error); > } > }; >@@ -155,7 +155,7 @@ static void testLoadCancelled(LoadStopTrackingTest* test, gconstpointer) > > static void testWebViewTitle(LoadTrackingTest* test, gconstpointer) > { >- g_assert(!webkit_web_view_get_title(test->m_webView)); >+ g_assert_null(webkit_web_view_get_title(test->m_webView)); > test->loadHtml("<html><head><title>Welcome to WebKit-GTK+!</title></head></html>", 0); > test->waitUntilLoadFinished(); > g_assert_cmpstr(webkit_web_view_get_title(test->m_webView), ==, "Welcome to WebKit-GTK+!"); >@@ -253,7 +253,7 @@ public: > ViewURITrackingTest() > : m_currentURI(webkit_web_view_get_uri(m_webView)) > { >- g_assert(m_currentURI.isNull()); >+ g_assert_true(m_currentURI.isNull()); > m_currentURIList.grow(m_currentURIList.capacity()); > g_signal_connect(m_webView, "notify::uri", G_CALLBACK(uriChanged), this); > } >@@ -292,7 +292,7 @@ public: > if (path) > ASSERT_CMP_CSTRING(m_currentURIList[state], ==, kServer->getURIForPath(path)); > else >- g_assert(m_currentURIList[state].isNull()); >+ g_assert_true(m_currentURIList[state].isNull()); > } > > private: >@@ -362,16 +362,16 @@ public: > void beginLoad() > { > // New load, load-started hasn't been emitted yet. >- g_assert(m_loadEvents.isEmpty()); >+ g_assert_true(m_loadEvents.isEmpty()); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > > void endLoad() > { > // Load finish, load-finished and load-failed haven't been emitted yet. >- g_assert(!m_loadEvents.isEmpty()); >- g_assert(!m_loadEvents.contains(LoadTrackingTest::LoadFinished)); >- g_assert(!m_loadEvents.contains(LoadTrackingTest::LoadFailed)); >+ g_assert_false(m_loadEvents.isEmpty()); >+ g_assert_false(m_loadEvents.contains(LoadTrackingTest::LoadFinished)); >+ g_assert_false(m_loadEvents.contains(LoadTrackingTest::LoadFailed)); > } > }; > >@@ -430,7 +430,7 @@ public: > reinterpret_cast<GDBusSignalCallback>(webPageURIChangedCallback), > this, > 0); >- g_assert(m_uriChangedSignalID); >+ g_assert_cmpuint(m_uriChangedSignalID, !=, 0); > > g_signal_connect(m_webView, "notify::uri", G_CALLBACK(webViewURIChanged), this); > } >@@ -498,9 +498,9 @@ static void testWebPageURI(WebPageURITest* test, gconstpointer) > static void testURIRequestHTTPHeaders(WebViewTest* test, gconstpointer) > { > GRefPtr<WebKitURIRequest> uriRequest = adoptGRef(webkit_uri_request_new("file:///foo/bar")); >- g_assert(uriRequest.get()); >+ g_assert_nonnull(uriRequest.get()); > g_assert_cmpstr(webkit_uri_request_get_uri(uriRequest.get()), ==, "file:///foo/bar"); >- g_assert(!webkit_uri_request_get_http_headers(uriRequest.get())); >+ g_assert_null(webkit_uri_request_get_http_headers(uriRequest.get())); > > // Load a request with no Do Not Track header. > webkit_uri_request_set_uri(uriRequest.get(), kServer->getURIForPath("/do-not-track-header").data()); >@@ -510,18 +510,18 @@ static void testURIRequestHTTPHeaders(WebViewTest* test, gconstpointer) > size_t mainResourceDataSize = 0; > const char* mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, strlen(kDNTHeaderNotPresent)); >- g_assert(!strncmp(mainResourceData, kDNTHeaderNotPresent, mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, kDNTHeaderNotPresent, mainResourceDataSize), ==, 0); > > // Add the Do Not Track header and load the request again. > SoupMessageHeaders* headers = webkit_uri_request_get_http_headers(uriRequest.get()); >- g_assert(headers); >+ g_assert_nonnull(headers); > soup_message_headers_append(headers, "DNT", "1"); > test->loadRequest(uriRequest.get()); > test->waitUntilLoadFinished(); > > mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, 1); >- g_assert(!strncmp(mainResourceData, "1", mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, "1", mainResourceDataSize), ==, 0); > > // Load a URI for which the web extension will add the Do Not Track header. > test->loadURI(kServer->getURIForPath("/add-do-not-track-header").data()); >@@ -529,15 +529,15 @@ static void testURIRequestHTTPHeaders(WebViewTest* test, gconstpointer) > > mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, 1); >- g_assert(!strncmp(mainResourceData, "1", mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, "1", mainResourceDataSize), ==, 0); > } > > static void testURIRequestHTTPMethod(WebViewTest* test, gconstpointer) > { > GRefPtr<WebKitURIRequest> uriRequest = adoptGRef(webkit_uri_request_new("file:///foo/bar")); >- g_assert(uriRequest.get()); >+ g_assert_nonnull(uriRequest.get()); > g_assert_cmpstr(webkit_uri_request_get_uri(uriRequest.get()), ==, "file:///foo/bar"); >- g_assert(!webkit_uri_request_get_http_method(uriRequest.get())); >+ g_assert_null(webkit_uri_request_get_http_method(uriRequest.get())); > > webkit_uri_request_set_uri(uriRequest.get(), kServer->getURIForPath("/http-get-method").data()); > test->loadRequest(uriRequest.get()); >@@ -551,19 +551,19 @@ static void testURIResponseHTTPHeaders(WebViewTest* test, gconstpointer) > test->loadHtml("<html><body>No HTTP headers</body></html>", "file:///"); > test->waitUntilLoadFinished(); > WebKitWebResource* resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(WEBKIT_IS_WEB_RESOURCE(resource)); >+ g_assert_true(WEBKIT_IS_WEB_RESOURCE(resource)); > WebKitURIResponse* response = webkit_web_resource_get_response(resource); >- g_assert(WEBKIT_IS_URI_RESPONSE(response)); >- g_assert(!webkit_uri_response_get_http_headers(response)); >+ g_assert_true(WEBKIT_IS_URI_RESPONSE(response)); >+ g_assert_null(webkit_uri_response_get_http_headers(response)); > > test->loadURI(kServer->getURIForPath("/headers").data()); > test->waitUntilLoadFinished(); > resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(WEBKIT_IS_WEB_RESOURCE(resource)); >+ g_assert_true(WEBKIT_IS_WEB_RESOURCE(resource)); > response = webkit_web_resource_get_response(resource); >- g_assert(WEBKIT_IS_URI_RESPONSE(response)); >+ g_assert_true(WEBKIT_IS_URI_RESPONSE(response)); > SoupMessageHeaders* headers = webkit_uri_response_get_http_headers(response); >- g_assert(headers); >+ g_assert_nonnull(headers); > g_assert_cmpstr(soup_message_headers_get_one(headers, "Foo"), ==, "bar"); > } > >@@ -576,7 +576,7 @@ static void testRedirectToDataURI(WebViewTest* test, gconstpointer) > size_t mainResourceDataSize = 0; > const char* mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, strlen(expectedData)); >- g_assert(!strncmp(mainResourceData, expectedData, mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, expectedData, mainResourceDataSize), ==, 0); > } > > static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >index b9b81733f79d5ff95f8294ecec00d150ca078308..8789772a0ad091493fa03b0532d8b9fe2d4cd885 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp >@@ -81,7 +81,7 @@ public: > nullptr, > G_DBUS_CALL_FLAGS_NONE, > -1, nullptr, nullptr)); >- g_assert(result); >+ g_assert_nonnull(result); > > guint32 identifier = 0; > g_variant_get(result.get(), "(u)", &identifier); >@@ -122,8 +122,8 @@ static void testProcessPerWebView(MultiprocessTest* test, gconstpointer) > > for (unsigned i = 0; i < numViews; i++) { > test->loadWebViewAndWaitUntilLoaded(i); >- g_assert(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get())); >- g_assert(test->m_webViewBusNames[i]); >+ g_assert_true(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get())); >+ g_assert_nonnull(test->m_webViewBusNames[i]); > } > > g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, numViews); >@@ -193,7 +193,7 @@ public: > > WebKitWebView* viewCreate(WebKitWebView* webView) > { >- g_assert(webView == m_webView); >+ g_assert_cmphex(webView, ==, m_webView); > > auto* newWebView = Test::createWebView(webView); > #if PLATFORM(GTK) >@@ -210,13 +210,13 @@ public: > > void viewReadyToShow(WebKitWebView* webView) > { >- g_assert(m_webView != webView); >+ g_assert_cmphex(m_webView, !=, webView); > m_webViewEvents.append(ReadyToShow); > } > > void viewClose(WebKitWebView* webView) > { >- g_assert(m_webView != webView); >+ g_assert_cmphex(m_webView, !=, webView); > > m_webViewEvents.append(Close); > g_object_unref(webView); >@@ -258,7 +258,7 @@ static void testWebProcessLimit(MultiprocessTest* test, gconstpointer) > // Create two web views but there should be only one web process. > for (unsigned i = 0; i < numViews; i++) { > test->loadWebViewAndWaitUntilLoaded(i); >- g_assert(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get())); >+ g_assert_true(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get())); > } > > g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, 1); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp >index 3470720f57db0e999338c8ed455dc096bc0813f0..65ef0fd5877202977431e4ddca5ebba804e86cd3 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp >@@ -58,7 +58,7 @@ public: > > static void resourceReceivedResponseCallback(WebKitWebResource* resource, GParamSpec*, ResourcesTest* test) > { >- g_assert(webkit_web_resource_get_response(resource)); >+ g_assert_nonnull(webkit_web_resource_get_response(resource)); > test->resourceReceivedResponse(resource); > } > >@@ -74,7 +74,7 @@ public: > > static void resourceFailedCallback(WebKitWebResource* resource, GError* error, ResourcesTest* test) > { >- g_assert(error); >+ g_assert_nonnull(error); > test->resourceFailed(resource, error); > } > >@@ -164,8 +164,8 @@ public: > size_t dataSize; > GUniqueOutPtr<GError> error; > unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr()); >- g_assert(!error.get()); >- g_assert(data); >+ g_assert_no_error(error.get()); >+ g_assert_nonnull(data); > g_assert_cmpint(dataSize, >, 0); > > ResourcesTest* test = static_cast<ResourcesTest*>(userData); >@@ -183,20 +183,20 @@ public: > const char* uri = webkit_web_resource_get_uri(resource); > if (uri == kServer->getURIForPath("/")) { > g_assert_cmpint(m_resourceDataSize, ==, strlen(kIndexHtml)); >- g_assert(!strncmp(m_resourceData.get(), kIndexHtml, m_resourceDataSize)); >+ g_assert_cmpint(strncmp(m_resourceData.get(), kIndexHtml, m_resourceDataSize), ==, 0); > } else if (uri == kServer->getURIForPath("/style.css")) { > g_assert_cmpint(m_resourceDataSize, ==, strlen(kStyleCSS)); >- g_assert(!strncmp(m_resourceData.get(), kStyleCSS, m_resourceDataSize)); >+ g_assert_cmpint(strncmp(m_resourceData.get(), kStyleCSS, m_resourceDataSize), ==, 0); > } else if (uri == kServer->getURIForPath("/javascript.js")) { > g_assert_cmpint(m_resourceDataSize, ==, strlen(kJavascript)); >- g_assert(!strncmp(m_resourceData.get(), kJavascript, m_resourceDataSize)); >+ g_assert_cmpint(strncmp(m_resourceData.get(), kJavascript, m_resourceDataSize), ==, 0); > } else if (uri == kServer->getURIForPath("/blank.ico")) { > GUniquePtr<char> filePath(g_build_filename(Test::getResourcesDir().data(), "blank.ico", nullptr)); > GUniqueOutPtr<char> contents; > gsize contentsLength; > g_file_get_contents(filePath.get(), &contents.outPtr(), &contentsLength, nullptr); > g_assert_cmpint(m_resourceDataSize, ==, contentsLength); >- g_assert(!memcmp(m_resourceData.get(), contents.get(), contentsLength)); >+ g_assert_cmpmem(m_resourceData.get(), contentsLength, contents.get(), contentsLength); > } else > g_assert_not_reached(); > m_resourceData.reset(); >@@ -212,26 +212,26 @@ public: > static void testWebViewResources(ResourcesTest* test, gconstpointer) > { > // Nothing loaded yet, there shoulnd't be resources. >- g_assert(!webkit_web_view_get_main_resource(test->m_webView)); >- g_assert(!test->subresources()); >+ g_assert_null(webkit_web_view_get_main_resource(test->m_webView)); >+ g_assert_null(test->subresources()); > > // Load simple page without subresources. > test->loadHtml("<html><body>Testing WebKitGTK+</body></html>", 0); > test->waitUntilLoadFinished(); > WebKitWebResource* resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_view_get_uri(test->m_webView), ==, webkit_web_resource_get_uri(resource)); >- g_assert(!test->subresources()); >+ g_assert_null(test->subresources()); > > // Load simple page with subresources. > test->loadURI(kServer->getURIForPath("/").data()); > test->waitUntilResourcesLoaded(4); > > resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_view_get_uri(test->m_webView), ==, webkit_web_resource_get_uri(resource)); > GList* subresources = test->subresources(); >- g_assert(subresources); >+ g_assert_nonnull(subresources); > g_assert_cmpint(g_list_length(subresources), ==, 3); > > #if 0 >@@ -315,7 +315,7 @@ public: > > if (!m_loadEvents.contains(Failed)) { > WebKitURIResponse* response = webkit_web_resource_get_response(m_resource.get()); >- g_assert(response); >+ g_assert_nonnull(response); > g_assert_cmpint(webkit_uri_response_get_content_length(response), ==, m_resourceDataReceived); > } > m_loadEvents.append(Finished); >@@ -338,7 +338,7 @@ public: > WebKitURIResponse* waitUntilResourceLoadFinishedAndReturnURIResponse() > { > waitUntilResourceLoadFinished(); >- g_assert(m_resource); >+ g_assert_nonnull(m_resource); > return webkit_web_resource_get_response(m_resource.get()); > } > >@@ -351,7 +351,7 @@ static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) > { > test->loadURI(kServer->getURIForPath("/javascript.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > Vector<SingleResourceLoadTest::LoadEvents>& events = test->m_loadEvents; > g_assert_cmpint(events.size(), ==, 5); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); >@@ -363,7 +363,7 @@ static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) > > test->loadURI(kServer->getURIForPath("/redirected-css.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > g_assert_cmpint(events.size(), ==, 6); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); > g_assert_cmpint(events[1], ==, SingleResourceLoadTest::SentRequest); >@@ -375,7 +375,7 @@ static void testWebResourceLoading(SingleResourceLoadTest* test, gconstpointer) > > test->loadURI(kServer->getURIForPath("/invalid-css.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); > g_assert_cmpint(events[1], ==, SingleResourceLoadTest::SentRequest); >@@ -440,7 +440,7 @@ static void testWebResourceSuggestedFilename(SingleResourceLoadTest* test, gcons > > test->loadURI(kServer->getURIForPath("/image.html").data()); > response = test->waitUntilResourceLoadFinishedAndReturnURIResponse(); >- g_assert(!webkit_uri_response_get_suggested_filename(response)); >+ g_assert_null(webkit_uri_response_get_suggested_filename(response)); > } > > class ResourceURITrackingTest: public SingleResourceLoadTest { >@@ -454,7 +454,7 @@ public: > > static void uriChanged(WebKitWebResource* resource, GParamSpec*, ResourceURITrackingTest* test) > { >- g_assert(resource == test->m_resource.get()); >+ g_assert_cmphex(resource, ==, test->m_resource.get()); > g_assert_cmpstr(test->m_activeURI.data(), !=, webkit_web_resource_get_uri(test->m_resource.get())); > test->m_activeURI = webkit_web_resource_get_uri(test->m_resource.get()); > } >@@ -528,7 +528,7 @@ static void testWebResourceGetData(ResourcesTest* test, gconstpointer) > test->waitUntilResourcesLoaded(4); > > WebKitWebResource* resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > test->checkResourceData(resource); > > GList* subresources = test->subresources(); >@@ -558,7 +558,7 @@ static void testWebResourceGetDataError(Test* test, gconstpointer) > size_t dataSize; > GUniqueOutPtr<GError> error; > auto* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(source), result, &dataSize, &error.outPtr()); >- g_assert(!data); >+ g_assert_null(data); > g_assert_error(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED); > g_main_loop_quit(static_cast<GMainLoop*>(userData)); > }, mainLoop.get()); >@@ -572,26 +572,26 @@ static void testWebViewResourcesHistoryCache(SingleResourceLoadTest* test, gcons > test->loadURI(javascriptURI.data()); > test->waitUntilResourceLoadFinished(); > WebKitWebResource* resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_resource_get_uri(resource), ==, javascriptURI.data()); > > CString simpleStyleCSSURI = kServer->getURIForPath("/simple-style-css.html"); > test->loadURI(simpleStyleCSSURI.data()); > test->waitUntilResourceLoadFinished(); > resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_resource_get_uri(resource), ==, simpleStyleCSSURI.data()); > > test->goBack(); > test->waitUntilResourceLoadFinished(); > resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_resource_get_uri(resource), ==, javascriptURI.data()); > > test->goForward(); > test->waitUntilResourceLoadFinished(); > resource = webkit_web_view_get_main_resource(test->m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > g_assert_cmpstr(webkit_web_resource_get_uri(resource), ==, simpleStyleCSSURI.data()); > } > >@@ -649,7 +649,7 @@ static void testWebResourceSendRequest(SendRequestTest* test, gconstpointer) > test->setExpectedNewResourceURI(kServer->getURIForPath("/javascript.js")); > test->loadURI(kServer->getURIForPath("relative-javascript.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > > Vector<SingleResourceLoadTest::LoadEvents>& events = test->m_loadEvents; > g_assert_cmpint(events.size(), ==, 5); >@@ -664,7 +664,7 @@ static void testWebResourceSendRequest(SendRequestTest* test, gconstpointer) > test->setExpectedCancelledResourceURI(kServer->getURIForPath("/cancel-this.js")); > test->loadURI(kServer->getURIForPath("/resource-to-cancel.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > > g_assert_cmpint(events.size(), ==, 3); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); >@@ -677,7 +677,7 @@ static void testWebResourceSendRequest(SendRequestTest* test, gconstpointer) > test->setExpectedNewResourceURIAfterRedirection(kServer->getURIForPath("/javascript-after-redirection.js")); > test->loadURI(kServer->getURIForPath("redirected-javascript.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > > g_assert_cmpint(events.size(), ==, 6); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); >@@ -693,7 +693,7 @@ static void testWebResourceSendRequest(SendRequestTest* test, gconstpointer) > test->setExpectedCancelledResourceURI(kServer->getURIForPath("/redirected-to-cancel.js")); > test->loadURI(kServer->getURIForPath("/redirected-to-cancel.html").data()); > test->waitUntilResourceLoadFinished(); >- g_assert(test->m_resource); >+ g_assert_nonnull(test->m_resource); > > g_assert_cmpint(events.size(), ==, 4); > g_assert_cmpint(events[0], ==, SingleResourceLoadTest::Started); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp >index 70e606b9872106ba7c03c4a9c7a8052ce66ccb63..66c786351adeda569bf7e42d2436fc988424ec47 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestSSL.cpp >@@ -72,19 +72,18 @@ static void testSSL(SSLTest* test, gconstpointer) > > test->loadURI(kHttpsServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_certificate); >+ g_assert_nonnull(test->m_certificate); > // Self-signed certificate has a nullptr issuer. >- g_assert(!g_tls_certificate_get_issuer(test->m_certificate.get())); >+ g_assert_null(g_tls_certificate_get_issuer(test->m_certificate.get())); > // We always expect errors because we are using a self-signed certificate, > // but only G_TLS_CERTIFICATE_UNKNOWN_CA flags should be present. >- g_assert(test->m_tlsErrors); > g_assert_cmpuint(test->m_tlsErrors, ==, G_TLS_CERTIFICATE_UNKNOWN_CA); > > // Non HTTPS loads shouldn't have a certificate nor errors. > test->loadHtml(indexHTML, 0); > test->waitUntilLoadFinished(); >- g_assert(!test->m_certificate); >- g_assert(!test->m_tlsErrors); >+ g_assert_null(test->m_certificate); >+ g_assert_cmpuint(test->m_tlsErrors, ==, 0); > > webkit_web_context_set_tls_errors_policy(context, originalPolicy); > } >@@ -102,7 +101,7 @@ public: > > static void insecureContentDetectedCallback(WebKitWebView* webView, WebKitInsecureContentEvent event, InsecureContentTest* test) > { >- g_assert(webView == test->m_webView); >+ g_assert_cmphex(webView, ==, test->m_webView); > > if (event == WEBKIT_INSECURE_CONTENT_RUN) > test->m_insecureContentRun = true; >@@ -124,10 +123,10 @@ static void testInsecureContent(InsecureContentTest* test, gconstpointer) > test->loadURI(kHttpsServer->getURIForPath("/insecure-content/").data()); > test->waitUntilLoadFinished(); > >- g_assert(!test->m_insecureContentRun); >+ g_assert_false(test->m_insecureContentRun); > // Images are currently always displayed, even bypassing mixed content settings. Check > // https://bugs.webkit.org/show_bug.cgi?id=142469 >- g_assert(test->m_insecureContentDisplayed); >+ g_assert_true(test->m_insecureContentDisplayed); > > webkit_web_context_set_tls_errors_policy(context, originalPolicy); > } >@@ -138,26 +137,26 @@ static void testTLSErrorsPolicy(SSLTest* test, gconstpointer) > { > WebKitWebContext* context = webkit_web_view_get_context(test->m_webView); > // TLS errors are treated as transport failures by default. >- g_assert(webkit_web_context_get_tls_errors_policy(context) == WEBKIT_TLS_ERRORS_POLICY_FAIL); >+ g_assert_cmpint(webkit_web_context_get_tls_errors_policy(context), ==, WEBKIT_TLS_ERRORS_POLICY_FAIL); > > assertIfSSLRequestProcessed = true; > test->loadURI(kHttpsServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadFailed); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); >+ g_assert_true(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); > assertIfSSLRequestProcessed = false; > > webkit_web_context_set_tls_errors_policy(context, WEBKIT_TLS_ERRORS_POLICY_IGNORE); >- g_assert(webkit_web_context_get_tls_errors_policy(context) == WEBKIT_TLS_ERRORS_POLICY_IGNORE); >+ g_assert_cmpint(webkit_web_context_get_tls_errors_policy(context), ==, WEBKIT_TLS_ERRORS_POLICY_IGNORE); > > test->m_loadFailed = false; > test->loadURI(kHttpsServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(!test->m_loadFailed); >+ g_assert_false(test->m_loadFailed); > > webkit_web_context_set_tls_errors_policy(context, WEBKIT_TLS_ERRORS_POLICY_FAIL); >- g_assert(webkit_web_context_get_tls_errors_policy(context) == WEBKIT_TLS_ERRORS_POLICY_FAIL); >+ g_assert_cmpint(webkit_web_context_get_tls_errors_policy(context), ==, WEBKIT_TLS_ERRORS_POLICY_FAIL); > } > > static void testTLSErrorsRedirect(SSLTest* test, gconstpointer) >@@ -169,9 +168,9 @@ static void testTLSErrorsRedirect(SSLTest* test, gconstpointer) > assertIfSSLRequestProcessed = true; > test->loadURI(kHttpsServer->getURIForPath("/redirect").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadFailed); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); >+ g_assert_true(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); > assertIfSSLRequestProcessed = false; > > webkit_web_context_set_tls_errors_policy(context, originalPolicy); >@@ -194,9 +193,9 @@ static void testTLSErrorsHTTPAuth(SSLTest* test, gconstpointer) > g_signal_connect(test->m_webView, "authenticate", G_CALLBACK(webViewAuthenticationCallback), NULL); > test->loadURI(kHttpsServer->getURIForPath("/auth").data()); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadFailed); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); >+ g_assert_true(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::LoadCommitted)); > assertIfSSLRequestProcessed = false; > > webkit_web_context_set_tls_errors_policy(context, originalPolicy); >@@ -251,7 +250,7 @@ static void testLoadFailedWithTLSErrors(TLSErrorsTest* test, gconstpointer) > // The load-failed-with-tls-errors signal should be emitted when there is a TLS failure. > test->loadURI(kHttpsServer->getURIForPath("/test-tls/").data()); > test->waitUntilLoadFinished(); >- g_assert(G_IS_TLS_CERTIFICATE(test->certificate())); >+ g_assert_true(G_IS_TLS_CERTIFICATE(test->certificate())); > g_assert_cmpuint(test->tlsErrors(), ==, G_TLS_CERTIFICATE_UNKNOWN_CA); > g_assert_cmpstr(test->host(), ==, soup_uri_get_host(kHttpsServer->baseURI())); > g_assert_cmpint(test->m_loadEvents[0], ==, LoadTrackingTest::ProvisionalLoadStarted); >@@ -335,7 +334,7 @@ static void testSubresourceLoadFailedWithTLSErrors(TLSSubresourceTest* test, gco > assertIfSSLRequestProcessed = true; > test->loadURI(kHttpServer->getURIForPath("/").data()); > test->waitUntilSubresourceLoadFail(); >- g_assert(G_IS_TLS_CERTIFICATE(test->m_certificate.get())); >+ g_assert_true(G_IS_TLS_CERTIFICATE(test->m_certificate.get())); > g_assert_cmpuint(test->m_tlsErrors, ==, G_TLS_CERTIFICATE_UNKNOWN_CA); > assertIfSSLRequestProcessed = false; > } >@@ -449,7 +448,7 @@ static void httpsServerCallback(SoupServer* server, SoupMessage* message, const > return; > } > >- g_assert(!assertIfSSLRequestProcessed); >+ g_assert_false(assertIfSSLRequestProcessed); > > if (g_str_equal(path, "/")) { > soup_message_set_status(message, SOUP_STATUS_OK); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp >index e5b6a89e8455fc3b53b800f2b00848de7b12f1e3..501a954b0cb61cb636d4f71b8ad129a9eb19d498 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp >@@ -147,7 +147,7 @@ public: > g_assert_cmpstr(webkit_script_dialog_get_message(dialog), ==, kAlertDialogMessage); > break; > case WEBKIT_SCRIPT_DIALOG_CONFIRM: >- g_assert(m_scriptDialogConfirmed); >+ g_assert_true(m_scriptDialogConfirmed); > g_assert_cmpstr(webkit_script_dialog_get_message(dialog), ==, "confirmed"); > > break; >@@ -213,7 +213,7 @@ public: > > static void mouseTargetChanged(WebKitWebView*, WebKitHitTestResult* hitTestResult, guint modifiers, UIClientTest* test) > { >- g_assert(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); >+ g_assert_true(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(hitTestResult)); > > test->m_mouseTargetHitTestResult = hitTestResult; >@@ -223,13 +223,13 @@ public: > > static gboolean permissionRequested(WebKitWebView*, WebKitPermissionRequest* request, UIClientTest* test) > { >- g_assert(WEBKIT_IS_PERMISSION_REQUEST(request)); >+ g_assert_true(WEBKIT_IS_PERMISSION_REQUEST(request)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > > if (test->m_verifyMediaTypes && WEBKIT_IS_USER_MEDIA_PERMISSION_REQUEST(request)) { > WebKitUserMediaPermissionRequest* userMediaRequest = WEBKIT_USER_MEDIA_PERMISSION_REQUEST(request); >- g_assert(webkit_user_media_permission_is_for_audio_device(userMediaRequest) == test->m_expectedAudioMedia); >- g_assert(webkit_user_media_permission_is_for_video_device(userMediaRequest) == test->m_expectedVideoMedia); >+ g_assert_true(webkit_user_media_permission_is_for_audio_device(userMediaRequest) == test->m_expectedAudioMedia); >+ g_assert_true(webkit_user_media_permission_is_for_video_device(userMediaRequest) == test->m_expectedVideoMedia); > } > > if (test->m_allowPermissionRequests) >@@ -327,8 +327,8 @@ public: > > virtual WebKitWebView* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation) > { >- g_assert(webView == m_webView); >- g_assert(navigation); >+ g_assert_cmphex(webView, ==, m_webView); >+ g_assert_nonnull(navigation); > > auto* newWebView = Test::createWebView(webkit_web_view_get_context(webView)); > #if PLATFORM(GTK) >@@ -338,7 +338,7 @@ public: > m_webViewEvents.append(Create); > > WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(WEBKIT_WEB_VIEW(newWebView)); >- g_assert(windowProperties); >+ g_assert_nonnull(windowProperties); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(windowProperties)); > m_windowPropertiesChanged.clear(); > >@@ -351,10 +351,10 @@ public: > > virtual void viewReadyToShow(WebKitWebView* webView) > { >- g_assert(webView != m_webView); >+ g_assert_cmphex(webView, !=, m_webView); > > WebKitWindowProperties* windowProperties = webkit_web_view_get_window_properties(webView); >- g_assert(windowProperties); >+ g_assert_nonnull(windowProperties); > if (!m_windowProperties.isNull()) > WindowProperties(windowProperties).assertEqual(m_windowProperties); > >@@ -363,7 +363,7 @@ public: > > virtual void viewClose(WebKitWebView* webView) > { >- g_assert(webView != m_webView); >+ g_assert_cmphex(webView, !=, m_webView); > > m_webViewEvents.append(Close); > g_object_unref(webView); >@@ -422,8 +422,8 @@ public: > > WebKitWebView* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation) > { >- g_assert(navigation); >- g_assert(!m_navigation); >+ g_assert_nonnull(navigation); >+ g_assert_null(m_navigation); > m_navigation = webkit_navigation_action_copy(navigation); > g_main_loop_quit(m_mainLoop); > return nullptr; >@@ -465,7 +465,7 @@ static void testWebViewCreateNavigationData(CreateNavigationDataTest* test, gcon > // FIXME: This should be button 1. > g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test->m_navigation), ==, 0); > g_assert_cmpuint(webkit_navigation_action_get_modifiers(test->m_navigation), ==, 0); >- g_assert(webkit_navigation_action_is_user_gesture(test->m_navigation)); >+ g_assert_true(webkit_navigation_action_is_user_gesture(test->m_navigation)); > > // Click on a link. > test->clickAndWaitUntilMainLoopFinishes(21, 21); >@@ -473,7 +473,7 @@ static void testWebViewCreateNavigationData(CreateNavigationDataTest* test, gcon > g_assert_cmpuint(webkit_navigation_action_get_navigation_type(test->m_navigation), ==, WEBKIT_NAVIGATION_TYPE_LINK_CLICKED); > g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test->m_navigation), ==, 1); > g_assert_cmpuint(webkit_navigation_action_get_modifiers(test->m_navigation), ==, 0); >- g_assert(webkit_navigation_action_is_user_gesture(test->m_navigation)); >+ g_assert_true(webkit_navigation_action_is_user_gesture(test->m_navigation)); > > // No user interaction. > test->loadHTML("<html><body onLoad=\"window.open();\"></html>"); >@@ -483,7 +483,7 @@ static void testWebViewCreateNavigationData(CreateNavigationDataTest* test, gcon > g_assert_cmpuint(webkit_navigation_action_get_navigation_type(test->m_navigation), ==, WEBKIT_NAVIGATION_TYPE_OTHER); > g_assert_cmpuint(webkit_navigation_action_get_mouse_button(test->m_navigation), ==, 0); > g_assert_cmpuint(webkit_navigation_action_get_modifiers(test->m_navigation), ==, 0); >- g_assert(!webkit_navigation_action_is_user_gesture(test->m_navigation)); >+ g_assert_false(webkit_navigation_action_is_user_gesture(test->m_navigation)); > } > #endif // PLATFORM(GTK) > >@@ -503,13 +503,13 @@ public: > > static void dialogRunAsModalCallback(WebKitWebView* webView, ModalDialogsTest* test) > { >- g_assert(webView != test->m_webView); >+ g_assert_cmphex(webView, !=, test->m_webView); > test->m_webViewEvents.append(RunAsModal); > } > > WebKitWebView* viewCreate(WebKitWebView* webView, WebKitNavigationAction* navigation) > { >- g_assert(webView == m_webView); >+ g_assert_cmphex(webView, ==, m_webView); > > auto* newWebView = UIClientTest::viewCreate(webView, navigation); > g_signal_connect(newWebView, "run-as-modal", G_CALLBACK(dialogRunAsModalCallback), this); >@@ -518,7 +518,7 @@ public: > > void viewReadyToShow(WebKitWebView* webView) > { >- g_assert(webView != m_webView); >+ g_assert_cmphex(webView, !=, m_webView); > m_webViewEvents.append(ReadyToShow); > } > }; >@@ -613,7 +613,7 @@ static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer) > test->m_scriptDialogConfirmed = false; > webkit_web_view_reload(test->m_webView); > test->waitUntilLoadFinished(); >- g_assert(test->m_scriptDialogConfirmed); >+ g_assert_true(test->m_scriptDialogConfirmed); > #endif > > // Navigation should trigger onbeforeunload. >@@ -621,7 +621,7 @@ static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer) > test->m_scriptDialogConfirmed = false; > test->loadHtml("<html></html>", nullptr); > test->waitUntilLoadFinished(); >- g_assert(test->m_scriptDialogConfirmed); >+ g_assert_true(test->m_scriptDialogConfirmed); > > // Try close should trigger onbeforeunload. > test->m_scriptDialogConfirmed = false; >@@ -629,7 +629,7 @@ static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer) > test->waitUntilLoadFinished(); > test->simulateUserInteraction(); > test->tryCloseAndWaitUntilClosed(); >- g_assert(test->m_scriptDialogConfirmed); >+ g_assert_true(test->m_scriptDialogConfirmed); > > // Try close on a page with no unload handlers should not trigger onbeforeunload, > // but should actually close the page. >@@ -637,10 +637,10 @@ static void testWebViewJavaScriptDialogs(UIClientTest* test, gconstpointer) > test->loadHtml("<html><body></body></html>", nullptr); > test->waitUntilLoadFinished(); > // We got a onbeforeunload of the previous page. >- g_assert(test->m_scriptDialogConfirmed); >+ g_assert_true(test->m_scriptDialogConfirmed); > test->m_scriptDialogConfirmed = false; > test->tryCloseAndWaitUntilClosed(); >- g_assert(!test->m_scriptDialogConfirmed); >+ g_assert_false(test->m_scriptDialogConfirmed); > #endif // PLATFORM(GTK) > } > >@@ -661,7 +661,7 @@ static void testWebViewWindowProperties(UIClientTest* test, gconstpointer) > "locationbar-visible", "menubar-visible", "statusbar-visible", "toolbar-visible", "scrollbars-visible" > }; > for (size_t i = 0; i < G_N_ELEMENTS(propertiesChanged); ++i) >- g_assert(test->m_windowPropertiesChanged.contains(propertiesChanged[i])); >+ g_assert_true(test->m_windowPropertiesChanged.contains(propertiesChanged[i])); > > Vector<UIClientTest::WebViewEvents>& events = test->m_webViewEvents; > g_assert_cmpint(events.size(), ==, 3); >@@ -699,90 +699,90 @@ static void testWebViewMouseTarget(UIClientTest* test, gconstpointer) > > // Move over link. > WebKitHitTestResult* hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 1); >- g_assert(webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_link_uri(hitTestResult), ==, "http://www.webkitgtk.org/"); > g_assert_cmpstr(webkit_hit_test_result_get_link_title(hitTestResult), ==, "WebKitGTK+ Title"); > g_assert_cmpstr(webkit_hit_test_result_get_link_label(hitTestResult), ==, "WebKitGTK+ Website"); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Move out of the link. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(0, 0); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Move over image with GDK_CONTROL_MASK. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 10, GDK_CONTROL_MASK); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef"); >- g_assert(test->m_mouseTargetModifiers & GDK_CONTROL_MASK); >+ g_assert_true(test->m_mouseTargetModifiers & GDK_CONTROL_MASK); > > // Move over image link. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 20); >- g_assert(webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_link_uri(hitTestResult), ==, "http://www.webkitgtk.org/logo"); > g_assert_cmpstr(webkit_hit_test_result_get_image_uri(hitTestResult), ==, "file:///0xdeadbeef"); > g_assert_cmpstr(webkit_hit_test_result_get_link_title(hitTestResult), ==, "WebKitGTK+ Logo"); >- g_assert(!webkit_hit_test_result_get_link_label(hitTestResult)); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_false(webkit_hit_test_result_get_link_label(hitTestResult)); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Move over media. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(1, 100); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > g_assert_cmpstr(webkit_hit_test_result_get_media_uri(hitTestResult), ==, "file:///movie.ogg"); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Mover over input. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(5, 35); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Move over scrollbar. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(gtk_widget_get_allocated_width(GTK_WIDGET(test->m_webView)) - 4, 5); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > > // Move over selection. > hitTestResult = test->moveMouseAndWaitUntilMouseTargetChanged(2, 145); >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_selection(hitTestResult)); >- g_assert(!test->m_mouseTargetModifiers); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_scrollbar(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_cmpuint(test->m_mouseTargetModifiers, ==, 0); > } > #endif // PLATFORM(GTK) > >@@ -995,16 +995,16 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer) > test->loadHtml(simpleFileUploadHTML.get(), 0); > test->waitUntilLoadFinished(); > WebKitFileChooserRequest* fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5); >- g_assert(!webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); >+ g_assert_false(webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); > > const gchar* const* mimeTypes = webkit_file_chooser_request_get_mime_types(fileChooserRequest); >- g_assert(!mimeTypes); >+ g_assert_null(mimeTypes); > #if PLATFORM(GTK) > GtkFileFilter* filter = webkit_file_chooser_request_get_mime_types_filter(fileChooserRequest); >- g_assert(!filter); >+ g_assert_null(filter); > #endif > const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(fileChooserRequest); >- g_assert(!selectedFiles); >+ g_assert_null(selectedFiles); > webkit_file_chooser_request_cancel(fileChooserRequest); > > // Multiple selections allowed, no MIME filtering, some pre-selected files. >@@ -1012,16 +1012,16 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer) > test->loadHtml(multipleSelectionFileUploadHTML.get(), 0); > test->waitUntilLoadFinished(); > fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5); >- g_assert(webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); >+ g_assert_true(webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); > > mimeTypes = webkit_file_chooser_request_get_mime_types(fileChooserRequest); >- g_assert(!mimeTypes); >+ g_assert_null(mimeTypes); > #if PLATFORM(GTK) > filter = webkit_file_chooser_request_get_mime_types_filter(fileChooserRequest); >- g_assert(!filter); >+ g_assert_null(filter); > #endif > selectedFiles = webkit_file_chooser_request_get_selected_files(fileChooserRequest); >- g_assert(!selectedFiles); >+ g_assert_null(selectedFiles); > > // Select some files. > const gchar* filesToSelect[4] = { "/foo", "/foo/bar", "/foo/bar/baz", 0 }; >@@ -1029,21 +1029,21 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer) > > // Check the files that have been just selected. > selectedFiles = webkit_file_chooser_request_get_selected_files(fileChooserRequest); >- g_assert(selectedFiles); >+ g_assert_nonnull(selectedFiles); > g_assert_cmpstr(selectedFiles[0], ==, "/foo"); > g_assert_cmpstr(selectedFiles[1], ==, "/foo/bar"); > g_assert_cmpstr(selectedFiles[2], ==, "/foo/bar/baz"); >- g_assert(!selectedFiles[3]); >+ g_assert_null(selectedFiles[3]); > > // Perform another request to check if the list of files selected > // in the previous step appears now as part of the new request. > fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5); > selectedFiles = webkit_file_chooser_request_get_selected_files(fileChooserRequest); >- g_assert(selectedFiles); >+ g_assert_nonnull(selectedFiles); > g_assert_cmpstr(selectedFiles[0], ==, "/foo"); > g_assert_cmpstr(selectedFiles[1], ==, "/foo/bar"); > g_assert_cmpstr(selectedFiles[2], ==, "/foo/bar/baz"); >- g_assert(!selectedFiles[3]); >+ g_assert_null(selectedFiles[3]); > webkit_file_chooser_request_cancel(fileChooserRequest); > > // Multiple selections not allowed, only accept images, audio and video files.. >@@ -1051,25 +1051,25 @@ static void testWebViewFileChooserRequest(FileChooserTest* test, gconstpointer) > test->loadHtml(mimeFilteredFileUploadHTML.get(), 0); > test->waitUntilLoadFinished(); > fileChooserRequest = test->clickMouseButtonAndWaitForFileChooserRequest(5, 5); >- g_assert(!webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); >+ g_assert_false(webkit_file_chooser_request_get_select_multiple(fileChooserRequest)); > > mimeTypes = webkit_file_chooser_request_get_mime_types(fileChooserRequest); >- g_assert(mimeTypes); >+ g_assert_nonnull(mimeTypes); > g_assert_cmpstr(mimeTypes[0], ==, "audio/*"); > g_assert_cmpstr(mimeTypes[1], ==, "video/*"); > g_assert_cmpstr(mimeTypes[2], ==, "image/*"); >- g_assert(!mimeTypes[3]); >+ g_assert_null(mimeTypes[3]); > > #if PLATFORM(GTK) > filter = webkit_file_chooser_request_get_mime_types_filter(fileChooserRequest); >- g_assert(GTK_IS_FILE_FILTER(filter)); >- g_assert(checkMimeTypeForFilter(filter, "audio/*")); >- g_assert(checkMimeTypeForFilter(filter, "video/*")); >- g_assert(checkMimeTypeForFilter(filter, "image/*")); >+ g_assert_true(GTK_IS_FILE_FILTER(filter)); >+ g_assert_true(checkMimeTypeForFilter(filter, "audio/*")); >+ g_assert_true(checkMimeTypeForFilter(filter, "video/*")); >+ g_assert_true(checkMimeTypeForFilter(filter, "image/*")); > #endif > > selectedFiles = webkit_file_chooser_request_get_selected_files(fileChooserRequest); >- g_assert(!selectedFiles); >+ g_assert_null(selectedFiles); > webkit_file_chooser_request_cancel(fileChooserRequest); > } > #endif // PLATFORM(GTK) >@@ -1087,7 +1087,7 @@ public: > > static void requestFinishedCallback(WebKitColorChooserRequest* request, ColorChooserTest* test) > { >- g_assert(test->m_request.get() == request); >+ g_assert_cmphex(test->m_request.get(), ==, request); > test->m_request = nullptr; > if (g_main_loop_is_running(test->m_mainLoop)) > g_main_loop_quit(test->m_mainLoop); >@@ -1100,7 +1100,7 @@ public: > > void runColorChooser(WebKitColorChooserRequest* request) > { >- g_assert(WEBKIT_IS_COLOR_CHOOSER_REQUEST(request)); >+ g_assert_true(WEBKIT_IS_COLOR_CHOOSER_REQUEST(request)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > m_request = request; > g_signal_connect(request, "finished", G_CALLBACK(requestFinishedCallback), this); >@@ -1109,23 +1109,23 @@ public: > > void finishRequest() > { >- g_assert(m_request.get()); >+ g_assert_nonnull(m_request.get()); > webkit_color_chooser_request_finish(m_request.get()); >- g_assert(!m_request); >+ g_assert_null(m_request); > } > > void cancelRequest() > { >- g_assert(m_request.get()); >+ g_assert_nonnull(m_request.get()); > webkit_color_chooser_request_cancel(m_request.get()); >- g_assert(!m_request); >+ g_assert_null(m_request); > } > > WebKitColorChooserRequest* clickMouseButtonAndWaitForColorChooserRequest(int x, int y) > { > clickMouseButton(x, y); > g_main_loop_run(m_mainLoop); >- g_assert(m_request.get()); >+ g_assert_nonnull(m_request.get()); > return m_request.get(); > } > >@@ -1147,13 +1147,13 @@ static void testWebViewColorChooserRequest(ColorChooserTest* test, gconstpointer > GdkRGBA rgba1; > GdkRGBA rgba2 = { 0., 0., 0., 1. }; > webkit_color_chooser_request_get_rgba(request, &rgba1); >- g_assert(gdk_rgba_equal(&rgba1, &rgba2)); >+ g_assert_true(gdk_rgba_equal(&rgba1, &rgba2)); > > // Set a different color. > rgba2.green = 1; > webkit_color_chooser_request_set_rgba(request, &rgba2); > webkit_color_chooser_request_get_rgba(request, &rgba1); >- g_assert(gdk_rgba_equal(&rgba1, &rgba2)); >+ g_assert_true(gdk_rgba_equal(&rgba1, &rgba2)); > > GdkRectangle rect; > webkit_color_chooser_request_get_element_rectangle(request, &rect); >@@ -1172,7 +1172,7 @@ static void testWebViewColorChooserRequest(ColorChooserTest* test, gconstpointer > > webkit_color_chooser_request_get_rgba(request, &rgba1); > GdkRGBA rgba3 = { 1., 0., 1., 1. }; >- g_assert(gdk_rgba_equal(&rgba1, &rgba3)); >+ g_assert_true(gdk_rgba_equal(&rgba1, &rgba3)); > > test->cancelRequest(); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp >index 98fa72412d6a42b187eee71553b5ef237f8c6c10..9810a4d1dd85af4c140acd0f490a66bc92d7bfd0 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebExtensions.cpp >@@ -46,7 +46,7 @@ static void testWebExtensionGetTitle(WebViewTest* test, gconstpointer) > g_variant_new("(t)", webkit_web_view_get_page_id(test->m_webView)), > G_DBUS_CALL_FLAGS_NONE, > -1, 0, 0)); >- g_assert(result); >+ g_assert_nonnull(result); > > const char* title; > g_variant_get(result.get(), "(&s)", &title); >@@ -128,7 +128,7 @@ static void testDocumentLoadedSignal(WebViewTest* test, gconstpointer) > reinterpret_cast<GDBusSignalCallback>(documentLoadedCallback), > test, > 0); >- g_assert(id); >+ g_assert_cmpuint(id, !=, 0); > > test->loadHtml("<html><head><title>WebKitGTK+ Web Extensions Test</title></head><body></body></html>", 0); > g_main_loop_run(test->m_mainLoop); >@@ -163,7 +163,7 @@ static void testWebKitWebViewProcessCrashed(WebViewTest* test, gconstpointer) > 0, > G_DBUS_CALL_FLAGS_NONE, > -1, 0, 0)); >- g_assert(!result); >+ g_assert_null(result); > g_main_loop_run(test->m_mainLoop); > test->m_expectedWebProcessCrash = false; > } >@@ -175,8 +175,8 @@ static void testWebExtensionWindowObjectCleared(WebViewTest* test, gconstpointer > > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.echo('Foo');", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "Foo"); > } >@@ -210,7 +210,7 @@ static void testWebExtensionIsolatedWorld(WebViewTest* test, gconstpointer) > g_assert_cmpstr(scriptDialogResult.get(), ==, "Main World"); > > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementById('console').innerHTML", 0); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "Foo"); > >@@ -233,7 +233,7 @@ static void testWebExtensionIsolatedWorld(WebViewTest* test, gconstpointer) > > // Check that 'top.foo' defined in main world is not visible in isolated world. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementById('console').innerHTML", 0); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "undefined"); > >@@ -248,7 +248,7 @@ static gboolean permissionRequestCallback(WebKitWebView*, WebKitPermissionReques > > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > WebKitInstallMissingMediaPluginsPermissionRequest* missingPluginsRequest = WEBKIT_INSTALL_MISSING_MEDIA_PLUGINS_PERMISSION_REQUEST(request); >- g_assert(webkit_install_missing_media_plugins_permission_request_get_description(missingPluginsRequest)); >+ g_assert_nonnull(webkit_install_missing_media_plugins_permission_request_get_description(missingPluginsRequest)); > webkit_permission_request_deny(request); > test->quitMainLoop(); > >@@ -278,7 +278,7 @@ static void didAssociateFormControlsCallback(GDBusConnection*, const char*, cons > { > const char* formIds; > g_variant_get(result, "(&s)", &formIds); >- g_assert(!g_strcmp0(formIds, FORM_ID FORM2_ID) || !g_strcmp0(formIds, FORM2_ID FORM_ID) || !g_strcmp0(formIds, INPUT_ID)); >+ g_assert_true(!g_strcmp0(formIds, FORM_ID FORM2_ID) || !g_strcmp0(formIds, FORM2_ID FORM_ID) || !g_strcmp0(formIds, INPUT_ID)); > > test->quitMainLoop(); > } >@@ -299,7 +299,7 @@ static void testWebExtensionFormControlsAssociated(WebViewTest* test, gconstpoin > reinterpret_cast<GDBusSignalCallback>(didAssociateFormControlsCallback), > test, > nullptr); >- g_assert(id); >+ g_assert_cmpuint(id, !=, 0); > > test->loadHtml("<!DOCTYPE html><head><title>WebKitGTK+ Web Extensions Test</title></head><div id=\"placeholder\"/>", 0); > test->waitUntilLoadFinished(); >@@ -354,7 +354,7 @@ public: > reinterpret_cast<GDBusSignalCallback>(willSendDOMEventCallback), > this, > nullptr); >- g_assert(m_willSendDOMEventCallbackID); >+ g_assert_cmpuint(m_willSendDOMEventCallbackID, !=, 0); > > m_willCompleteCallbackID = g_dbus_connection_signal_subscribe(connection, > nullptr, >@@ -366,7 +366,7 @@ public: > reinterpret_cast<GDBusSignalCallback>(willCompleteCallback), > this, > nullptr); >- g_assert(m_willCompleteCallbackID); >+ g_assert_cmpuint(m_willCompleteCallbackID, !=, 0); > } > > ~FormSubmissionTest() >@@ -388,8 +388,8 @@ public: > g_assert_cmpstr(formID, ==, FORM_SUBMISSION_TEST_ID); > g_assert_cmpstr(concatenatedTextFieldNames, ==, "foo,bar,"); > g_assert_cmpstr(concatenatedTextFieldValues, ==, "first,second,"); >- g_assert(!targetFrameIsMainFrame); >- g_assert(sourceFrameIsMainFrame); >+ g_assert_false(targetFrameIsMainFrame); >+ g_assert_true(sourceFrameIsMainFrame); > } > > static void willSendDOMEventCallback(GDBusConnection*, const char*, const char*, const char*, const char*, GVariant* result, FormSubmissionTest* test) >@@ -434,16 +434,16 @@ static void testWebExtensionFormSubmissionSteps(FormSubmissionTest* test, gconst > test->runJavaScriptAndWaitUntilFormSubmitted(submitFormScript); > // Submit must not be emitted when the form is submitted via JS. > // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit >- g_assert(!test->m_willSendDOMEventCallbackExecuted); >- g_assert(test->m_willCompleteCallbackExecuted); >+ g_assert_false(test->m_willSendDOMEventCallbackExecuted); >+ g_assert_true(test->m_willCompleteCallbackExecuted); > test->m_willCompleteCallbackExecuted = false; > > static const char* manuallySubmitFormScript = > "var button = document.getElementById(\"submit_button\");" > "button.click();"; > test->runJavaScriptAndWaitUntilFormSubmitted(manuallySubmitFormScript); >- g_assert(test->m_willSendDOMEventCallbackExecuted); >- g_assert(test->m_willCompleteCallbackExecuted); >+ g_assert_true(test->m_willSendDOMEventCallbackExecuted); >+ g_assert_true(test->m_willCompleteCallbackExecuted); > test->m_willSendDOMEventCallbackExecuted = false; > test->m_willCompleteCallbackExecuted = false; > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp >index 25ebc4b91368fb0159e6a40e004d0c34d3d01ac8..40ec721412b37e4f7bf8ba4fd113d1de5b7be18a 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp >@@ -65,7 +65,7 @@ public: > static void viewFaviconChangedCallback(WebKitWebView* webView, GParamSpec* pspec, gpointer data) > { > FaviconDatabaseTest* test = static_cast<FaviconDatabaseTest*>(data); >- g_assert(test->m_webView == webView); >+ g_assert_cmphex(test->m_webView, ==, webView); > test->m_faviconNotificationReceived = true; > test->quitMainLoop(); > } >@@ -101,7 +101,7 @@ public: > > void waitUntilFaviconURIChanged() > { >- g_assert(!m_waitingForFaviconURI); >+ g_assert_false(m_waitingForFaviconURI); > m_faviconURI = CString(); > m_waitingForFaviconURI = true; > g_main_loop_run(m_mainLoop); >@@ -154,8 +154,8 @@ static void testNotInitialized(FaviconDatabaseTest* test) > { > // Try to retrieve a valid favicon from a not initialized database. > test->getFaviconForPageURIAndWaitUntilReady(kServer->getURIForPath("/foo").data()); >- g_assert(!test->m_favicon); >- g_assert(test->m_error); >+ g_assert_null(test->m_favicon); >+ g_assert_nonnull(test->m_error); > g_assert_cmpint(test->m_error->code, ==, WEBKIT_FAVICON_DATABASE_ERROR_NOT_INITIALIZED); > } > #endif >@@ -173,7 +173,7 @@ static void testClearDatabase(FaviconDatabaseTest* test) > webkit_favicon_database_clear(database); > > GUniquePtr<char> iconURI(webkit_favicon_database_get_favicon_uri(database, kServer->getURIForPath("/foo").data())); >- g_assert(!iconURI); >+ g_assert_null(iconURI); > } > > static void ephemeralViewLoadChanged(WebKitWebView* webView, WebKitLoadEvent loadEvent, WebViewTest* test) >@@ -196,8 +196,8 @@ static void testPrivateBrowsing(FaviconDatabaseTest* test) > > // An ephemeral web view should not write to the database. > test->getFaviconForPageURIAndWaitUntilReady(kServer->getURIForPath("/foo").data()); >- g_assert(!test->m_favicon); >- g_assert(test->m_error); >+ g_assert_null(test->m_favicon); >+ g_assert_nonnull(test->m_error); > } > > static void testGetFavicon(FaviconDatabaseTest* test) >@@ -210,9 +210,9 @@ static void testGetFavicon(FaviconDatabaseTest* test) > > // Check the API retrieving a valid favicon. > test->getFaviconForPageURIAndWaitUntilReady(kServer->getURIForPath("/foo").data()); >- g_assert(test->m_favicon); >+ g_assert_nonnull(test->m_favicon); > g_assert_cmpstr(test->m_faviconURI.data(), ==, faviconURI.data()); >- g_assert(!test->m_error); >+ g_assert_no_error(test->m_error.get()); > > // Check that width and height match those from blank.ico (16x16 favicon). > g_assert_cmpint(cairo_image_surface_get_width(test->m_favicon), ==, 16); >@@ -226,10 +226,10 @@ static void testGetFavicon(FaviconDatabaseTest* test) > test->waitUntilFaviconChanged(); > test->waitUntilFaviconChanged(); > test->getFaviconForPageURIAndWaitUntilReady(kServer->getURIForPath("/bar").data()); >- g_assert(test->m_favicon); >+ g_assert_nonnull(test->m_favicon); > g_assert_cmpstr(test->m_faviconURI.data(), ==, faviconURI.data()); >- g_assert(test->m_favicon == favicon); >- g_assert(!test->m_error); >+ g_assert_cmphex(test->m_favicon, ==, favicon); >+ g_assert_no_error(test->m_error.get()); > cairo_surface_destroy(favicon); > > // Check the API retrieving an invalid favicon. Favicon changes only once to reset it, then >@@ -239,8 +239,8 @@ static void testGetFavicon(FaviconDatabaseTest* test) > test->waitUntilFaviconURIChanged(); > > test->getFaviconForPageURIAndWaitUntilReady(kServer->getURIForPath("/nofavicon").data()); >- g_assert(!test->m_favicon); >- g_assert(test->m_error); >+ g_assert_null(test->m_favicon); >+ g_assert_nonnull(test->m_error); > } > > static void testGetFaviconURI(FaviconDatabaseTest* test) >@@ -257,17 +257,17 @@ static void testWebViewFavicon(FaviconDatabaseTest* test) > test->m_faviconURI = CString(); > > cairo_surface_t* iconFromWebView = webkit_web_view_get_favicon(test->m_webView); >- g_assert(!iconFromWebView); >+ g_assert_null(iconFromWebView); > > test->loadURI(kServer->getURIForPath("/foo").data()); > test->waitUntilFaviconChanged(); >- g_assert(test->m_faviconNotificationReceived); >+ g_assert_true(test->m_faviconNotificationReceived); > // The icon is known and hasn't changed in the database, so notify::favicon is emitted > // but WebKitFaviconDatabase::icon-changed isn't. >- g_assert(test->m_faviconURI.isNull()); >+ g_assert_true(test->m_faviconURI.isNull()); > > iconFromWebView = webkit_web_view_get_favicon(test->m_webView); >- g_assert(iconFromWebView); >+ g_assert_nonnull(iconFromWebView); > g_assert_cmpuint(cairo_image_surface_get_width(iconFromWebView), ==, 16); > g_assert_cmpuint(cairo_image_surface_get_height(iconFromWebView), ==, 16); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp >index 7658f59599ddb8d3affc818527fa4645527ef1e8..480a34b71b0cfdd78f65ceba820bac27afe7ae60 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp >@@ -98,7 +98,7 @@ static void testFindControllerTextFound(FindControllerTest* test, gconstpointer) > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 1); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > } > > static void testFindControllerTextNotFound(FindControllerTest* test, gconstpointer) >@@ -109,7 +109,7 @@ static void testFindControllerTextNotFound(FindControllerTest* test, gconstpoint > test->find("notFound", WEBKIT_FIND_OPTIONS_NONE, 1); > test->waitUntilFindFinished(); > >- g_assert(!test->m_textFound); >+ g_assert_false(test->m_textFound); > } > > static void testFindControllerMatchCount(FindControllerTest* test, gconstpointer) >@@ -120,8 +120,8 @@ static void testFindControllerMatchCount(FindControllerTest* test, gconstpointer > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_matchCount == 2); >- g_assert(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 2); >+ g_assert_true(test->m_textFound); > } > > static void testFindControllerMaxMatchCount(FindControllerTest* test, gconstpointer) >@@ -132,8 +132,8 @@ static void testFindControllerMaxMatchCount(FindControllerTest* test, gconstpoin > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 1); > test->waitUntilFindFinished(); > >- g_assert(test->m_matchCount == G_MAXUINT); >- g_assert(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, G_MAXUINT); >+ g_assert_true(test->m_textFound); > } > > static void testFindControllerNext(FindControllerTest* test, gconstpointer) >@@ -144,22 +144,22 @@ static void testFindControllerNext(FindControllerTest* test, gconstpointer) > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >- g_assert(test->m_matchCount == 2); >+ g_assert_true(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 2); > > webkit_find_controller_search_next(test->m_findController.get()); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >- g_assert(test->m_matchCount == 1); >- g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS)); >+ g_assert_true(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 1); >+ g_assert_false(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS); > > webkit_find_controller_search_next(test->m_findController.get()); > test->waitUntilFindFinished(); > >- g_assert(!test->m_textFound); >- g_assert(test->m_matchCount == 1); >- g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS)); >+ g_assert_false(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 1); >+ g_assert_false(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS); > } > > static void testFindControllerPrevious(FindControllerTest* test, gconstpointer) >@@ -170,22 +170,22 @@ static void testFindControllerPrevious(FindControllerTest* test, gconstpointer) > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_matchCount == 2); >- g_assert(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 2); >+ g_assert_true(test->m_textFound); > > webkit_find_controller_search_next(test->m_findController.get()); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >- g_assert(test->m_matchCount == 1); >- g_assert(!(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS)); >+ g_assert_true(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 1); >+ g_assert_false(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS); > > webkit_find_controller_search_previous(test->m_findController.get()); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >- g_assert(test->m_matchCount == 1); >- g_assert(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS); >+ g_assert_true(test->m_textFound); >+ g_assert_cmpuint(test->m_matchCount, ==, 1); >+ g_assert_true(webkit_find_controller_get_options(test->m_findController.get()) & WEBKIT_FIND_OPTIONS_BACKWARDS); > } > > static void testFindControllerCountedMatches(FindControllerTest* test, gconstpointer) >@@ -196,17 +196,17 @@ static void testFindControllerCountedMatches(FindControllerTest* test, gconstpoi > test->count("testing", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_matchCount == 2); >+ g_assert_cmpuint(test->m_matchCount, ==, 2); > > test->count("first", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_matchCount == 1); >+ g_assert_cmpuint(test->m_matchCount, ==, 1); > > test->count("notFound", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(!test->m_matchCount); >+ g_assert_cmpuint(test->m_matchCount, ==, 0); > } > > static void testFindControllerOptions(FindControllerTest* test, gconstpointer) >@@ -217,44 +217,44 @@ static void testFindControllerOptions(FindControllerTest* test, gconstpointer) > test->find("Testing", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(!test->m_textFound); >+ g_assert_false(test->m_textFound); > > test->find("Testing", WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > test->find("esting", WEBKIT_FIND_OPTIONS_NONE, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > test->find("esting", WEBKIT_FIND_OPTIONS_AT_WORD_STARTS, 2); > test->waitUntilFindFinished(); > >- g_assert(!test->m_textFound); >+ g_assert_false(test->m_textFound); > > test->find("Half", WEBKIT_FIND_OPTIONS_AT_WORD_STARTS, 2); > test->waitUntilFindFinished(); > >- g_assert(!test->m_textFound); >+ g_assert_false(test->m_textFound); > > test->find("Half", WEBKIT_FIND_OPTIONS_AT_WORD_STARTS | WEBKIT_FIND_OPTIONS_TREAT_MEDIAL_CAPITAL_AS_WORD_START, 2); > test->waitUntilFindFinished(); > >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > test->find("testing", WEBKIT_FIND_OPTIONS_WRAP_AROUND, 3); > test->waitUntilFindFinished(); >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > webkit_find_controller_search_next(test->m_findController.get()); > test->waitUntilFindFinished(); >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > webkit_find_controller_search_next(test->m_findController.get()); > test->waitUntilFindFinished(); >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > } > > // TODO: Rewrite this test to avoid using snapshots so it can be re-enabled >@@ -269,16 +269,16 @@ static void testFindControllerHide(FindControllerTest* test, gconstpointer) > > cairo_surface_t* originalSurface = cairo_surface_reference( > test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT, WEBKIT_SNAPSHOT_OPTIONS_NONE)); >- g_assert(originalSurface); >+ g_assert_nonnull(originalSurface); > > test->find("testing", WEBKIT_FIND_OPTIONS_NONE, 1); > test->waitUntilFindFinished(); >- g_assert(test->m_textFound); >+ g_assert_true(test->m_textFound); > > cairo_surface_t* highlightSurface = cairo_surface_reference( > test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT, WEBKIT_SNAPSHOT_OPTIONS_NONE)); >- g_assert(highlightSurface); >- g_assert(!Test::cairoSurfacesEqual(originalSurface, highlightSurface)); >+ g_assert_nonnull(highlightSurface); >+ g_assert_false(Test::cairoSurfacesEqual(originalSurface, highlightSurface)); > > WebKitFindController* findController = webkit_web_view_get_find_controller(test->m_webView); > webkit_find_controller_search_finish(findController); >@@ -286,8 +286,8 @@ static void testFindControllerHide(FindControllerTest* test, gconstpointer) > > cairo_surface_t* unhighlightSurface = cairo_surface_reference( > test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT, WEBKIT_SNAPSHOT_OPTIONS_NONE)); >- g_assert(unhighlightSurface); >- g_assert(Test::cairoSurfacesEqual(originalSurface, unhighlightSurface)); >+ g_assert_nonnull(unhighlightSurface); >+ g_assert_true(Test::cairoSurfacesEqual(originalSurface, unhighlightSurface)); > > cairo_surface_destroy(originalSurface); > cairo_surface_destroy(highlightSurface); >@@ -300,7 +300,7 @@ static void testFindControllerInstance(FindControllerTest* test, gconstpointer) > WebKitFindController* findController1 = webkit_web_view_get_find_controller(test->m_webView); > WebKitFindController* findController2 = webkit_web_view_get_find_controller(test->m_webView); > >- g_assert(findController1 == findController2); >+ g_assert_cmphex(findController1, ==, findController2); > } > > static void testFindControllerGetters(FindControllerTest* test, gconstpointer) >@@ -311,10 +311,10 @@ static void testFindControllerGetters(FindControllerTest* test, gconstpointer) > WebKitFindController* findController = webkit_web_view_get_find_controller(test->m_webView); > > webkit_find_controller_search(findController, searchText, findOptions, maxMatchCount); >- g_assert(webkit_find_controller_get_web_view(findController) == test->m_webView); >- g_assert(!g_strcmp0(webkit_find_controller_get_search_text(findController), searchText)); >- g_assert(webkit_find_controller_get_max_match_count(findController) == maxMatchCount); >- g_assert(webkit_find_controller_get_options(findController) == findOptions); >+ g_assert_cmphex(webkit_find_controller_get_web_view(findController), ==, test->m_webView); >+ g_assert_cmpstr(webkit_find_controller_get_search_text(findController), ==, searchText); >+ g_assert_cmpuint(webkit_find_controller_get_max_match_count(findController), ==, maxMatchCount); >+ g_assert_cmpuint(webkit_find_controller_get_options(findController), ==, findOptions); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp >index a9fd9de33bd1f546634ac3102cf70e485f354333..769bcc8916bb9b1c1afe29d6bc209dd4328016a6 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp >@@ -122,7 +122,7 @@ static void testNavigationPolicy(PolicyClientTest* test, gconstpointer) > g_assert_cmpint(webkit_navigation_action_get_mouse_button(navigationAction), ==, 0); > g_assert_cmpint(webkit_navigation_action_get_modifiers(navigationAction), ==, 0); > g_assert_false(webkit_navigation_action_is_redirect(navigationAction)); >- g_assert(!webkit_navigation_policy_decision_get_frame_name(decision)); >+ g_assert_null(webkit_navigation_policy_decision_get_frame_name(decision)); > WebKitURIRequest* request = webkit_navigation_action_get_request(navigationAction); > g_assert_cmpstr(webkit_uri_request_get_uri(request), ==, "http://webkitgtk.org/"); > >@@ -141,7 +141,7 @@ static void testNavigationPolicy(PolicyClientTest* test, gconstpointer) > decision = WEBKIT_NAVIGATION_POLICY_DECISION(test->m_previousPolicyDecision.get()); > navigationAction = webkit_navigation_policy_decision_get_navigation_action(decision); > g_assert_true(webkit_navigation_action_is_redirect(navigationAction)); >- g_assert(!webkit_navigation_policy_decision_get_frame_name(decision)); >+ g_assert_null(webkit_navigation_policy_decision_get_frame_name(decision)); > request = webkit_navigation_action_get_request(navigationAction); > g_assert_cmpstr(webkit_uri_request_get_uri(request), ==, kServer->getURIForPath("/").data()); > >@@ -174,12 +174,12 @@ static void testResponsePolicy(PolicyClientTest* test, gconstpointer) > > WebKitResponsePolicyDecision* decision = WEBKIT_RESPONSE_POLICY_DECISION(test->m_previousPolicyDecision.get()); > WebKitURIRequest* request = webkit_response_policy_decision_get_request(decision); >- g_assert(WEBKIT_IS_URI_REQUEST(request)); >+ g_assert_true(WEBKIT_IS_URI_REQUEST(request)); > ASSERT_CMP_CSTRING(webkit_uri_request_get_uri(request), ==, kServer->getURIForPath("/")); > WebKitURIResponse* response = webkit_response_policy_decision_get_response(decision); >- g_assert(WEBKIT_IS_URI_RESPONSE(response)); >+ g_assert_true(WEBKIT_IS_URI_RESPONSE(response)); > ASSERT_CMP_CSTRING(webkit_uri_response_get_uri(response), ==, kServer->getURIForPath("/")); >- g_assert(webkit_web_view_can_show_mime_type(test->m_webView, webkit_uri_response_get_mime_type(response)) == >+ g_assert_cmpint(webkit_web_view_can_show_mime_type(test->m_webView, webkit_uri_response_get_mime_type(response)), ==, > webkit_response_policy_decision_is_mime_type_supported(decision)); > > test->m_respondToPolicyDecisionAsynchronously = true; >@@ -235,7 +235,7 @@ static void testNewWindowPolicy(PolicyClientTest* test, gconstpointer) > test->m_policyDecisionResponse = PolicyClientTest::Use; > test->loadHtml(windowOpeningHTML, "http://webkitgtk.org/"); > test->wait(1); >- g_assert(data.triedToOpenWindow); >+ g_assert_true(data.triedToOpenWindow); > > WebKitNavigationPolicyDecision* decision = WEBKIT_NAVIGATION_POLICY_DECISION(test->m_previousPolicyDecision.get()); > g_assert_cmpstr(webkit_navigation_policy_decision_get_frame_name(decision), ==, "_blank"); >@@ -247,7 +247,7 @@ static void testNewWindowPolicy(PolicyClientTest* test, gconstpointer) > test->m_policyDecisionResponse = PolicyClientTest::Ignore; > test->loadHtml(windowOpeningHTML, "http://webkitgtk.org/"); > test->wait(.2); >- g_assert(!data.triedToOpenWindow); >+ g_assert_false(data.triedToOpenWindow); > } > > static void serverCallback(SoupServer* server, SoupMessage* message, const char* path, GHashTable*, SoupClientContext*, gpointer) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp >index 1bafd7e2db588efc91724ecd8d684b97d9f25c91..5dc74c779bef33e1a47f38be791b9a36a7663049 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSecurityOrigin.cpp >@@ -25,105 +25,105 @@ > static void testSecurityOriginBasicConstructor(Test*, gconstpointer) > { > WebKitSecurityOrigin* origin = webkit_security_origin_new("http", "127.0.0.1", 1234); >- g_assert(origin); >+ g_assert_nonnull(origin); > GUniquePtr<char> asString(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1:1234"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 1234); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > } > > static void testSecurityOriginURIConstructor(Test*, gconstpointer) > { > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri("http://127.0.0.1:1234"); >- g_assert(origin); >+ g_assert_nonnull(origin); > GUniquePtr<char> asString(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1:1234"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 1234); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > > origin = webkit_security_origin_new_for_uri("http://127.0.0.1:1234/this/path/?should=be#ignored"); >- g_assert(origin); >+ g_assert_nonnull(origin); > asString.reset(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1:1234"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 1234); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > } > > static void testSecurityOriginDefaultPort(Test*, gconstpointer) > { > WebKitSecurityOrigin* origin = webkit_security_origin_new("http", "127.0.0.1", 0); >- g_assert(origin); >+ g_assert_nonnull(origin); > GUniquePtr<char> asString(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > > origin = webkit_security_origin_new("http", "127.0.0.1", 80); >- g_assert(origin); >+ g_assert_nonnull(origin); > asString.reset(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > > origin = webkit_security_origin_new_for_uri("http://127.0.0.1"); >- g_assert(origin); >+ g_assert_nonnull(origin); > asString.reset(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > > origin = webkit_security_origin_new_for_uri("http://127.0.0.1:80"); >- g_assert(origin); >+ g_assert_nonnull(origin); > asString.reset(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "http://127.0.0.1"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "http"); > g_assert_cmpstr(webkit_security_origin_get_host(origin), ==, "127.0.0.1"); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > } > > static void testSecurityOriginFileURI(Test*, gconstpointer) > { > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri("file:///abcdefg"); >- g_assert(origin); >+ g_assert_nonnull(origin); > GUniquePtr<char> asString(webkit_security_origin_to_string(origin)); > g_assert_cmpstr(asString.get(), ==, "file://"); > g_assert_cmpstr(webkit_security_origin_get_protocol(origin), ==, "file"); >- g_assert(!webkit_security_origin_get_host(origin)); >+ g_assert_null(webkit_security_origin_get_host(origin)); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(!webkit_security_origin_is_opaque(origin)); >+ g_assert_false(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > } > > static void testOpaqueSecurityOrigin(Test*, gconstpointer) > { > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri("data:Lali ho!"); >- g_assert(origin); >+ g_assert_nonnull(origin); > GUniquePtr<char> asString(webkit_security_origin_to_string(origin)); >- g_assert(!asString); >- g_assert(!webkit_security_origin_get_protocol(origin)); >- g_assert(!webkit_security_origin_get_host(origin)); >+ g_assert_null(asString); >+ g_assert_null(webkit_security_origin_get_protocol(origin)); >+ g_assert_null(webkit_security_origin_get_host(origin)); > g_assert_cmpint(webkit_security_origin_get_port(origin), ==, 0); >- g_assert(webkit_security_origin_is_opaque(origin)); >+ g_assert_true(webkit_security_origin_is_opaque(origin)); > webkit_security_origin_unref(origin); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp >index c59b5136a2f5dca4b1b6bc6b6c0ad6bcb15a95dd..3edd53ced97d32e9934adaa56bd612943788e49f 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp >@@ -42,64 +42,64 @@ static void testWebKitSettings(Test*, gconstpointer) > WebKitSettings* settings = webkit_settings_new(); > > // JavaScript is enabled by default. >- g_assert(webkit_settings_get_enable_javascript(settings)); >+ g_assert_true(webkit_settings_get_enable_javascript(settings)); > webkit_settings_set_enable_javascript(settings, FALSE); >- g_assert(!webkit_settings_get_enable_javascript(settings)); >+ g_assert_false(webkit_settings_get_enable_javascript(settings)); > > // By default auto-load-image is true. >- g_assert(webkit_settings_get_auto_load_images(settings)); >+ g_assert_true(webkit_settings_get_auto_load_images(settings)); > webkit_settings_set_auto_load_images(settings, FALSE); >- g_assert(!webkit_settings_get_auto_load_images(settings)); >+ g_assert_false(webkit_settings_get_auto_load_images(settings)); > > // load-icons-ignoring-image-load-setting is false by default. >- g_assert(!webkit_settings_get_load_icons_ignoring_image_load_setting(settings)); >+ g_assert_false(webkit_settings_get_load_icons_ignoring_image_load_setting(settings)); > webkit_settings_set_load_icons_ignoring_image_load_setting(settings, TRUE); >- g_assert(webkit_settings_get_load_icons_ignoring_image_load_setting(settings)); >+ g_assert_true(webkit_settings_get_load_icons_ignoring_image_load_setting(settings)); > > // Offline application cache is true by default. >- g_assert(webkit_settings_get_enable_offline_web_application_cache(settings)); >+ g_assert_true(webkit_settings_get_enable_offline_web_application_cache(settings)); > webkit_settings_set_enable_offline_web_application_cache(settings, FALSE); >- g_assert(!webkit_settings_get_enable_offline_web_application_cache(settings)); >+ g_assert_false(webkit_settings_get_enable_offline_web_application_cache(settings)); > > // Local storage is enable by default. >- g_assert(webkit_settings_get_enable_html5_local_storage(settings)); >+ g_assert_true(webkit_settings_get_enable_html5_local_storage(settings)); > webkit_settings_set_enable_html5_local_storage(settings, FALSE); >- g_assert(!webkit_settings_get_enable_html5_local_storage(settings)); >+ g_assert_false(webkit_settings_get_enable_html5_local_storage(settings)); > > // HTML5 database is enabled by default. >- g_assert(webkit_settings_get_enable_html5_database(settings)); >+ g_assert_true(webkit_settings_get_enable_html5_database(settings)); > webkit_settings_set_enable_html5_database(settings, FALSE); >- g_assert(!webkit_settings_get_enable_html5_database(settings)); >+ g_assert_false(webkit_settings_get_enable_html5_database(settings)); > > // XSS Auditor is enabled by default. >- g_assert(webkit_settings_get_enable_xss_auditor(settings)); >+ g_assert_true(webkit_settings_get_enable_xss_auditor(settings)); > webkit_settings_set_enable_xss_auditor(settings, FALSE); >- g_assert(!webkit_settings_get_enable_xss_auditor(settings)); >+ g_assert_false(webkit_settings_get_enable_xss_auditor(settings)); > > // Frame flattening is disabled by default. >- g_assert(!webkit_settings_get_enable_frame_flattening(settings)); >+ g_assert_false(webkit_settings_get_enable_frame_flattening(settings)); > webkit_settings_set_enable_frame_flattening(settings, TRUE); >- g_assert(webkit_settings_get_enable_frame_flattening(settings)); >+ g_assert_true(webkit_settings_get_enable_frame_flattening(settings)); > > // Plugins are enabled by default. >- g_assert(webkit_settings_get_enable_plugins(settings)); >+ g_assert_true(webkit_settings_get_enable_plugins(settings)); > webkit_settings_set_enable_plugins(settings, FALSE); >- g_assert(!webkit_settings_get_enable_plugins(settings)); >+ g_assert_false(webkit_settings_get_enable_plugins(settings)); > > // Java is enabled by default. >- g_assert(webkit_settings_get_enable_java(settings)); >+ g_assert_true(webkit_settings_get_enable_java(settings)); > webkit_settings_set_enable_java(settings, FALSE); >- g_assert(!webkit_settings_get_enable_java(settings)); >+ g_assert_false(webkit_settings_get_enable_java(settings)); > > // By default, JavaScript can open windows automatically is disabled. >- g_assert(!webkit_settings_get_javascript_can_open_windows_automatically(settings)); >+ g_assert_false(webkit_settings_get_javascript_can_open_windows_automatically(settings)); > webkit_settings_set_javascript_can_open_windows_automatically(settings, TRUE); >- g_assert(webkit_settings_get_javascript_can_open_windows_automatically(settings)); >+ g_assert_true(webkit_settings_get_javascript_can_open_windows_automatically(settings)); > > // By default hyper link auditing is disabled. >- g_assert(!webkit_settings_get_enable_hyperlink_auditing(settings)); >+ g_assert_false(webkit_settings_get_enable_hyperlink_auditing(settings)); > webkit_settings_set_enable_hyperlink_auditing(settings, TRUE); >- g_assert(webkit_settings_get_enable_hyperlink_auditing(settings)); >+ g_assert_true(webkit_settings_get_enable_hyperlink_auditing(settings)); > > // Default font family is "sans-serif". > g_assert_cmpstr(webkit_settings_get_default_font_family(settings), ==, "sans-serif"); >@@ -202,142 +202,142 @@ static void testWebKitSettings(Test*, gconstpointer) > > #if PLATFORM(GTK) > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; >- g_assert(!webkit_settings_get_enable_private_browsing(settings)); >+ g_assert_false(webkit_settings_get_enable_private_browsing(settings)); > webkit_settings_set_enable_private_browsing(settings, TRUE); >- g_assert(webkit_settings_get_enable_private_browsing(settings)); >+ g_assert_true(webkit_settings_get_enable_private_browsing(settings)); > G_GNUC_END_IGNORE_DEPRECATIONS; > #endif > >- g_assert(!webkit_settings_get_enable_developer_extras(settings)); >+ g_assert_false(webkit_settings_get_enable_developer_extras(settings)); > webkit_settings_set_enable_developer_extras(settings, TRUE); >- g_assert(webkit_settings_get_enable_developer_extras(settings)); >+ g_assert_true(webkit_settings_get_enable_developer_extras(settings)); > >- g_assert(webkit_settings_get_enable_resizable_text_areas(settings)); >+ g_assert_true(webkit_settings_get_enable_resizable_text_areas(settings)); > webkit_settings_set_enable_resizable_text_areas(settings, FALSE); >- g_assert(!webkit_settings_get_enable_resizable_text_areas(settings)); >+ g_assert_false(webkit_settings_get_enable_resizable_text_areas(settings)); > >- g_assert(webkit_settings_get_enable_tabs_to_links(settings)); >+ g_assert_true(webkit_settings_get_enable_tabs_to_links(settings)); > webkit_settings_set_enable_tabs_to_links(settings, FALSE); >- g_assert(!webkit_settings_get_enable_tabs_to_links(settings)); >+ g_assert_false(webkit_settings_get_enable_tabs_to_links(settings)); > >- g_assert(!webkit_settings_get_enable_dns_prefetching(settings)); >+ g_assert_false(webkit_settings_get_enable_dns_prefetching(settings)); > webkit_settings_set_enable_dns_prefetching(settings, TRUE); >- g_assert(webkit_settings_get_enable_dns_prefetching(settings)); >+ g_assert_true(webkit_settings_get_enable_dns_prefetching(settings)); > > // Caret browsing is disabled by default. >- g_assert(!webkit_settings_get_enable_caret_browsing(settings)); >+ g_assert_false(webkit_settings_get_enable_caret_browsing(settings)); > webkit_settings_set_enable_caret_browsing(settings, TRUE); >- g_assert(webkit_settings_get_enable_caret_browsing(settings)); >+ g_assert_true(webkit_settings_get_enable_caret_browsing(settings)); > > // Fullscreen JavaScript API is enabled by default. >- g_assert(webkit_settings_get_enable_fullscreen(settings)); >+ g_assert_true(webkit_settings_get_enable_fullscreen(settings)); > webkit_settings_set_enable_fullscreen(settings, FALSE); >- g_assert(!webkit_settings_get_enable_fullscreen(settings)); >+ g_assert_false(webkit_settings_get_enable_fullscreen(settings)); > > // Print backgrounds is enabled by default >- g_assert(webkit_settings_get_print_backgrounds(settings)); >+ g_assert_true(webkit_settings_get_print_backgrounds(settings)); > webkit_settings_set_print_backgrounds(settings, FALSE); >- g_assert(!webkit_settings_get_print_backgrounds(settings)); >+ g_assert_false(webkit_settings_get_print_backgrounds(settings)); > > // WebAudio is disabled by default. >- g_assert(!webkit_settings_get_enable_webaudio(settings)); >+ g_assert_false(webkit_settings_get_enable_webaudio(settings)); > webkit_settings_set_enable_webaudio(settings, TRUE); >- g_assert(webkit_settings_get_enable_webaudio(settings)); >+ g_assert_true(webkit_settings_get_enable_webaudio(settings)); > > // WebGL is disabled by default. >- g_assert(!webkit_settings_get_enable_webgl(settings)); >+ g_assert_false(webkit_settings_get_enable_webgl(settings)); > webkit_settings_set_enable_webgl(settings, TRUE); >- g_assert(webkit_settings_get_enable_webgl(settings)); >+ g_assert_true(webkit_settings_get_enable_webgl(settings)); > > // Allow Modal Dialogs is disabled by default. >- g_assert(!webkit_settings_get_allow_modal_dialogs(settings)); >+ g_assert_false(webkit_settings_get_allow_modal_dialogs(settings)); > webkit_settings_set_allow_modal_dialogs(settings, TRUE); >- g_assert(webkit_settings_get_allow_modal_dialogs(settings)); >+ g_assert_true(webkit_settings_get_allow_modal_dialogs(settings)); > > // Zoom text only is disabled by default. >- g_assert(!webkit_settings_get_zoom_text_only(settings)); >+ g_assert_false(webkit_settings_get_zoom_text_only(settings)); > webkit_settings_set_zoom_text_only(settings, TRUE); >- g_assert(webkit_settings_get_zoom_text_only(settings)); >+ g_assert_true(webkit_settings_get_zoom_text_only(settings)); > > // By default, JavaScript cannot access the clipboard. >- g_assert(!webkit_settings_get_javascript_can_access_clipboard(settings)); >+ g_assert_false(webkit_settings_get_javascript_can_access_clipboard(settings)); > webkit_settings_set_javascript_can_access_clipboard(settings, TRUE); >- g_assert(webkit_settings_get_javascript_can_access_clipboard(settings)); >+ g_assert_true(webkit_settings_get_javascript_can_access_clipboard(settings)); > > // By default, media playback doesn't require user gestures. >- g_assert(!webkit_settings_get_media_playback_requires_user_gesture(settings)); >+ g_assert_false(webkit_settings_get_media_playback_requires_user_gesture(settings)); > webkit_settings_set_media_playback_requires_user_gesture(settings, TRUE); >- g_assert(webkit_settings_get_media_playback_requires_user_gesture(settings)); >+ g_assert_true(webkit_settings_get_media_playback_requires_user_gesture(settings)); > > // By default, inline media playback is allowed >- g_assert(webkit_settings_get_media_playback_allows_inline(settings)); >+ g_assert_true(webkit_settings_get_media_playback_allows_inline(settings)); > webkit_settings_set_media_playback_allows_inline(settings, FALSE); >- g_assert(!webkit_settings_get_media_playback_allows_inline(settings)); >+ g_assert_false(webkit_settings_get_media_playback_allows_inline(settings)); > > // By default, debug indicators are disabled. >- g_assert(!webkit_settings_get_draw_compositing_indicators(settings)); >+ g_assert_false(webkit_settings_get_draw_compositing_indicators(settings)); > webkit_settings_set_draw_compositing_indicators(settings, TRUE); >- g_assert(webkit_settings_get_draw_compositing_indicators(settings)); >+ g_assert_true(webkit_settings_get_draw_compositing_indicators(settings)); > > // By default, site specific quirks are enabled. >- g_assert(webkit_settings_get_enable_site_specific_quirks(settings)); >+ g_assert_true(webkit_settings_get_enable_site_specific_quirks(settings)); > webkit_settings_set_enable_site_specific_quirks(settings, FALSE); >- g_assert(!webkit_settings_get_enable_site_specific_quirks(settings)); >+ g_assert_false(webkit_settings_get_enable_site_specific_quirks(settings)); > > // By default, page cache is enabled. >- g_assert(webkit_settings_get_enable_page_cache(settings)); >+ g_assert_true(webkit_settings_get_enable_page_cache(settings)); > webkit_settings_set_enable_page_cache(settings, FALSE); >- g_assert(!webkit_settings_get_enable_page_cache(settings)); >+ g_assert_false(webkit_settings_get_enable_page_cache(settings)); > > // By default, smooth scrolling is disabled. >- g_assert(!webkit_settings_get_enable_smooth_scrolling(settings)); >+ g_assert_false(webkit_settings_get_enable_smooth_scrolling(settings)); > webkit_settings_set_enable_smooth_scrolling(settings, TRUE); >- g_assert(webkit_settings_get_enable_smooth_scrolling(settings)); >+ g_assert_true(webkit_settings_get_enable_smooth_scrolling(settings)); > > // By default, accelerated 2D canvas is disabled. >- g_assert(!webkit_settings_get_enable_accelerated_2d_canvas(settings)); >+ g_assert_false(webkit_settings_get_enable_accelerated_2d_canvas(settings)); > webkit_settings_set_enable_accelerated_2d_canvas(settings, TRUE); >- g_assert(webkit_settings_get_enable_accelerated_2d_canvas(settings)); >+ g_assert_true(webkit_settings_get_enable_accelerated_2d_canvas(settings)); > > // By default, writing of console messages to stdout is disabled. >- g_assert(!webkit_settings_get_enable_write_console_messages_to_stdout(settings)); >+ g_assert_false(webkit_settings_get_enable_write_console_messages_to_stdout(settings)); > webkit_settings_set_enable_write_console_messages_to_stdout(settings, TRUE); >- g_assert(webkit_settings_get_enable_write_console_messages_to_stdout(settings)); >+ g_assert_true(webkit_settings_get_enable_write_console_messages_to_stdout(settings)); > > // MediaStream is disabled by default. >- g_assert(!webkit_settings_get_enable_media_stream(settings)); >+ g_assert_false(webkit_settings_get_enable_media_stream(settings)); > webkit_settings_set_enable_media_stream(settings, TRUE); >- g_assert(webkit_settings_get_enable_media_stream(settings)); >+ g_assert_true(webkit_settings_get_enable_media_stream(settings)); > > // By default, SpatialNavigation is disabled >- g_assert(!webkit_settings_get_enable_spatial_navigation(settings)); >+ g_assert_false(webkit_settings_get_enable_spatial_navigation(settings)); > webkit_settings_set_enable_spatial_navigation(settings, TRUE); >- g_assert(webkit_settings_get_enable_spatial_navigation(settings)); >+ g_assert_true(webkit_settings_get_enable_spatial_navigation(settings)); > > // MediaSource is enabled by default >- g_assert(webkit_settings_get_enable_mediasource(settings)); >+ g_assert_true(webkit_settings_get_enable_mediasource(settings)); > webkit_settings_set_enable_mediasource(settings, FALSE); >- g_assert(!webkit_settings_get_enable_mediasource(settings)); >+ g_assert_false(webkit_settings_get_enable_mediasource(settings)); > > // EncryptedMedia is disabled by default >- g_assert(!webkit_settings_get_enable_encrypted_media(settings)); >+ g_assert_false(webkit_settings_get_enable_encrypted_media(settings)); > webkit_settings_set_enable_encrypted_media(settings, TRUE); >- g_assert(webkit_settings_get_enable_encrypted_media(settings)); >+ g_assert_true(webkit_settings_get_enable_encrypted_media(settings)); > > // MediaCapabilities is disabled by default >- g_assert(!webkit_settings_get_enable_media_capabilities(settings)); >+ g_assert_false(webkit_settings_get_enable_media_capabilities(settings)); > webkit_settings_set_enable_media_capabilities(settings, TRUE); >- g_assert(webkit_settings_get_enable_media_capabilities(settings)); >+ g_assert_true(webkit_settings_get_enable_media_capabilities(settings)); > > // File access from file URLs is not allowed by default. >- g_assert(!webkit_settings_get_allow_file_access_from_file_urls(settings)); >+ g_assert_false(webkit_settings_get_allow_file_access_from_file_urls(settings)); > webkit_settings_set_allow_file_access_from_file_urls(settings, TRUE); >- g_assert(webkit_settings_get_allow_file_access_from_file_urls(settings)); >+ g_assert_true(webkit_settings_get_allow_file_access_from_file_urls(settings)); > > // Universal access from file URLs is not allowed by default. >- g_assert(!webkit_settings_get_allow_universal_access_from_file_urls(settings)); >+ g_assert_false(webkit_settings_get_allow_universal_access_from_file_urls(settings)); > webkit_settings_set_allow_universal_access_from_file_urls(settings, TRUE); >- g_assert(webkit_settings_get_allow_universal_access_from_file_urls(settings)); >+ g_assert_true(webkit_settings_get_allow_universal_access_from_file_urls(settings)); > > #if PLATFORM(GTK) > // Ondemand is the default hardware acceleration policy. >@@ -361,9 +361,9 @@ void testWebKitSettingsNewWithSettings(Test* test, gconstpointer) > "load-icons-ignoring-image-load-setting", TRUE, > nullptr)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(settings.get())); >- g_assert(!webkit_settings_get_enable_javascript(settings.get())); >- g_assert(!webkit_settings_get_auto_load_images(settings.get())); >- g_assert(webkit_settings_get_load_icons_ignoring_image_load_setting(settings.get())); >+ g_assert_false(webkit_settings_get_enable_javascript(settings.get())); >+ g_assert_false(webkit_settings_get_auto_load_images(settings.get())); >+ g_assert_true(webkit_settings_get_load_icons_ignoring_image_load_setting(settings.get())); > } > > #if PLATFORM(GTK) >@@ -387,8 +387,8 @@ static void testWebKitSettingsUserAgent(WebViewTest* test, gconstpointer) > CString defaultUserAgent = webkit_settings_get_user_agent(settings.get()); > webkit_web_view_set_settings(test->m_webView, settings.get()); > >- g_assert(g_strstr_len(defaultUserAgent.data(), -1, "AppleWebKit")); >- g_assert(g_strstr_len(defaultUserAgent.data(), -1, "Safari")); >+ g_assert_nonnull(g_strstr_len(defaultUserAgent.data(), -1, "AppleWebKit")); >+ g_assert_nonnull(g_strstr_len(defaultUserAgent.data(), -1, "Safari")); > > webkit_settings_set_user_agent(settings.get(), 0); > g_assert_cmpstr(defaultUserAgent.data(), ==, webkit_settings_get_user_agent(settings.get())); >@@ -405,15 +405,15 @@ static void testWebKitSettingsUserAgent(WebViewTest* test, gconstpointer) > webkit_settings_set_user_agent_with_application_details(settings.get(), "WebKitGTK+", 0); > const char* userAgentWithNullVersion = webkit_settings_get_user_agent(settings.get()); > g_assert_cmpstr(g_strstr_len(userAgentWithNullVersion, -1, defaultUserAgent.data()), ==, userAgentWithNullVersion); >- g_assert(g_strstr_len(userAgentWithNullVersion, -1, "WebKitGTK+")); >+ g_assert_nonnull(g_strstr_len(userAgentWithNullVersion, -1, "WebKitGTK+")); > > webkit_settings_set_user_agent_with_application_details(settings.get(), "WebKitGTK+", ""); > g_assert_cmpstr(webkit_settings_get_user_agent(settings.get()), ==, userAgentWithNullVersion); > > webkit_settings_set_user_agent_with_application_details(settings.get(), "WebCatGTK+", "3.4.5"); > const char* newUserAgent = webkit_settings_get_user_agent(settings.get()); >- g_assert(g_strstr_len(newUserAgent, -1, "3.4.5")); >- g_assert(g_strstr_len(newUserAgent, -1, "WebCatGTK+")); >+ g_assert_nonnull(g_strstr_len(newUserAgent, -1, "3.4.5")); >+ g_assert_nonnull(g_strstr_len(newUserAgent, -1, "WebCatGTK+")); > > GUniquePtr<char> applicationUserAgent(g_strdup_printf("%s %s", defaultUserAgent.data(), "WebCatGTK+/3.4.5")); > g_assert_cmpstr(applicationUserAgent.get(), ==, webkit_settings_get_user_agent(settings.get())); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp >index 2e4e49ff7477dfcfd57e5536fdde0302f6da4805..d95a61b0a6b9c75cfea3f36895555e4f57f67b75 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp >@@ -41,10 +41,10 @@ static void testWebViewNewWithUserContentManager(Test* test, gconstpointer) > GRefPtr<WebKitUserContentManager> userContentManager1 = adoptGRef(webkit_user_content_manager_new()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(userContentManager1.get())); > auto webView1 = Test::adoptView(Test::createWebView(userContentManager1.get())); >- g_assert(webkit_web_view_get_user_content_manager(webView1.get()) == userContentManager1.get()); >+ g_assert_cmphex(webkit_web_view_get_user_content_manager(webView1.get()), ==, userContentManager1.get()); > > auto webView2 = Test::adoptView(Test::createWebView()); >- g_assert(webkit_web_view_get_user_content_manager(webView2.get()) != userContentManager1.get()); >+ g_assert_cmphex(webkit_web_view_get_user_content_manager(webView2.get()), !=, userContentManager1.get()); > } > > static bool isStyleSheetInjectedForURLAtPath(WebViewTest* test, const char* path, const char* world = nullptr) >@@ -55,8 +55,8 @@ static bool isStyleSheetInjectedForURLAtPath(WebViewTest* test, const char* path > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = world ? test->runJavaScriptInWorldAndWaitUntilFinished(kStyleSheetTestScript, world, &error.outPtr()) > : test->runJavaScriptAndWaitUntilFinished(kStyleSheetTestScript, &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > > GUniquePtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult)); > return !g_strcmp0(resultString.get(), kStyleSheetTestScriptResult); >@@ -71,7 +71,7 @@ static bool isScriptInjectedForURLAtPath(WebViewTest* test, const char* path, co > WebKitJavascriptResult* javascriptResult = world ? test->runJavaScriptInWorldAndWaitUntilFinished(kScriptTestScript, world, &error.outPtr()) > : test->runJavaScriptAndWaitUntilFinished(kScriptTestScript, &error.outPtr()); > if (javascriptResult) { >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > > GUniquePtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult)); > return !g_strcmp0(resultString.get(), kScriptTestScriptResult); >@@ -120,19 +120,19 @@ static void testUserContentManagerInjectedStyleSheet(WebViewTest* test, gconstpo > > // Without a whitelist or a blacklist all URLs should have the injected style sheet. > static const char* randomPath = "somerandompath"; >- g_assert(!isStyleSheetInjectedForURLAtPath(test, randomPath)); >+ g_assert_false(isStyleSheetInjectedForURLAtPath(test, randomPath)); > WebKitUserStyleSheet* styleSheet = webkit_user_style_sheet_new(kInjectedStyleSheet, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_USER, nullptr, nullptr); > webkit_user_content_manager_add_style_sheet(test->m_userContentManager.get(), styleSheet); > webkit_user_style_sheet_unref(styleSheet); >- g_assert(isStyleSheetInjectedForURLAtPath(test, randomPath)); >+ g_assert_true(isStyleSheetInjectedForURLAtPath(test, randomPath)); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >- g_assert(!isStyleSheetInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); >+ g_assert_false(isStyleSheetInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); > styleSheet = webkit_user_style_sheet_new_for_world(kInjectedStyleSheet, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_USER, "WebExtensionTestScriptWorld", nullptr, nullptr); > webkit_user_content_manager_add_style_sheet(test->m_userContentManager.get(), styleSheet); > webkit_user_style_sheet_unref(styleSheet); >- g_assert(isStyleSheetInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); >+ g_assert_true(isStyleSheetInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >@@ -140,8 +140,8 @@ static void testUserContentManagerInjectedStyleSheet(WebViewTest* test, gconstpo > styleSheet = webkit_user_style_sheet_new(kInjectedStyleSheet, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_USER, nullptr, blacklist); > webkit_user_content_manager_add_style_sheet(test->m_userContentManager.get(), styleSheet); > webkit_user_style_sheet_unref(styleSheet); >- g_assert(!isStyleSheetInjectedForURLAtPath(test, randomPath)); >- g_assert(isStyleSheetInjectedForURLAtPath(test, "someotherrandompath")); >+ g_assert_false(isStyleSheetInjectedForURLAtPath(test, randomPath)); >+ g_assert_true(isStyleSheetInjectedForURLAtPath(test, "someotherrandompath")); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >@@ -154,9 +154,9 @@ static void testUserContentManagerInjectedStyleSheet(WebViewTest* test, gconstpo > styleSheet = webkit_user_style_sheet_new(kInjectedStyleSheet, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_USER, whitelist, blacklist); > webkit_user_content_manager_add_style_sheet(test->m_userContentManager.get(), styleSheet); > webkit_user_style_sheet_unref(styleSheet); >- g_assert(isStyleSheetInjectedForURLAtPath(test, inTheWhiteList)); >- g_assert(!isStyleSheetInjectedForURLAtPath(test, inTheWhiteListAndBlackList)); >- g_assert(!isStyleSheetInjectedForURLAtPath(test, notInWhitelist)); >+ g_assert_true(isStyleSheetInjectedForURLAtPath(test, inTheWhiteList)); >+ g_assert_false(isStyleSheetInjectedForURLAtPath(test, inTheWhiteListAndBlackList)); >+ g_assert_false(isStyleSheetInjectedForURLAtPath(test, notInWhitelist)); > > // It's important to clean up the environment before other tests. > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); >@@ -171,19 +171,19 @@ static void testUserContentManagerInjectedScript(WebViewTest* test, gconstpointe > > // Without a whitelist or a blacklist all URLs should have the injected script. > static const char* randomPath = "somerandompath"; >- g_assert(!isScriptInjectedForURLAtPath(test, randomPath)); >+ g_assert_false(isScriptInjectedForURLAtPath(test, randomPath)); > WebKitUserScript* script = webkit_user_script_new(kInjectedScript, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, nullptr, nullptr); > webkit_user_content_manager_add_script(test->m_userContentManager.get(), script); > webkit_user_script_unref(script); >- g_assert(isScriptInjectedForURLAtPath(test, randomPath)); >+ g_assert_true(isScriptInjectedForURLAtPath(test, randomPath)); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >- g_assert(!isScriptInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); >+ g_assert_false(isScriptInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); > script = webkit_user_script_new_for_world(kInjectedScript, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, "WebExtensionTestScriptWorld", nullptr, nullptr); > webkit_user_content_manager_add_script(test->m_userContentManager.get(), script); > webkit_user_script_unref(script); >- g_assert(isScriptInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); >+ g_assert_true(isScriptInjectedForURLAtPath(test, randomPath, "WebExtensionTestScriptWorld")); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >@@ -191,8 +191,8 @@ static void testUserContentManagerInjectedScript(WebViewTest* test, gconstpointe > script = webkit_user_script_new(kInjectedScript, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, nullptr, blacklist); > webkit_user_content_manager_add_script(test->m_userContentManager.get(), script); > webkit_user_script_unref(script); >- g_assert(!isScriptInjectedForURLAtPath(test, randomPath)); >- g_assert(isScriptInjectedForURLAtPath(test, "someotherrandompath")); >+ g_assert_false(isScriptInjectedForURLAtPath(test, randomPath)); >+ g_assert_true(isScriptInjectedForURLAtPath(test, "someotherrandompath")); > > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); > >@@ -205,9 +205,9 @@ static void testUserContentManagerInjectedScript(WebViewTest* test, gconstpointe > script = webkit_user_script_new(kInjectedScript, WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_END, whitelist, blacklist); > webkit_user_content_manager_add_script(test->m_userContentManager.get(), script); > webkit_user_script_unref(script); >- g_assert(isScriptInjectedForURLAtPath(test, inTheWhiteList)); >- g_assert(!isScriptInjectedForURLAtPath(test, inTheWhiteListAndBlackList)); >- g_assert(!isScriptInjectedForURLAtPath(test, notInWhitelist)); >+ g_assert_true(isScriptInjectedForURLAtPath(test, inTheWhiteList)); >+ g_assert_false(isScriptInjectedForURLAtPath(test, inTheWhiteListAndBlackList)); >+ g_assert_false(isScriptInjectedForURLAtPath(test, notInWhitelist)); > > // It's important to clean up the environment before other tests. > removeOldInjectedContentAndResetLists(test->m_userContentManager.get(), whitelist, blacklist); >@@ -246,7 +246,7 @@ public: > if (!test->m_waitForScriptRun) > g_main_loop_quit(test->m_mainLoop); > >- g_assert(!test->m_userScriptMessage); >+ g_assert_null(test->m_userScriptMessage); > test->m_userScriptMessage = webkit_javascript_result_ref(jsResult); > } > >@@ -261,14 +261,14 @@ public: > g_signal_connect(m_userContentManager.get(), signalName.get(), G_CALLBACK(scriptMessageReceived), this); > > g_main_loop_run(m_mainLoop); >- g_assert(!m_waitForScriptRun); >- g_assert(m_userScriptMessage); >+ g_assert_false(m_waitForScriptRun); >+ g_assert_nonnull(m_userScriptMessage); > return m_userScriptMessage; > } > > static void runJavaScriptFinished(GObject*, GAsyncResult* result, UserScriptMessageTest* test) > { >- g_assert(test->m_waitForScriptRun); >+ g_assert_true(test->m_waitForScriptRun); > test->m_waitForScriptRun = false; > g_main_loop_quit(test->m_mainLoop); > } >@@ -291,10 +291,10 @@ private: > > static void testUserContentManagerScriptMessageReceived(UserScriptMessageTest* test, gconstpointer) > { >- g_assert(test->registerHandler("msg")); >+ g_assert_true(test->registerHandler("msg")); > > // Trying to register the same handler a second time must fail. >- g_assert(!test->registerHandler("msg")); >+ g_assert_false(test->registerHandler("msg")); > > test->loadHtml("<html></html>", nullptr); > test->waitUntilLoadFinished(); >@@ -302,15 +302,15 @@ static void testUserContentManagerScriptMessageReceived(UserScriptMessageTest* t > // Check that the "window.webkit.messageHandlers" namespace exists. > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers ? 'y' : 'n';", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "y"); > > // Check that the "document.webkit.messageHandlers.msg" namespace exists. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers.msg ? 'y' : 'n';", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "y"); > >@@ -318,19 +318,19 @@ static void testUserContentManagerScriptMessageReceived(UserScriptMessageTest* t > g_assert_cmpstr(valueString.get(), ==, "user message"); > > // Messages should arrive despite of other handlers being registered. >- g_assert(test->registerHandler("anotherHandler")); >+ g_assert_true(test->registerHandler("anotherHandler")); > > // Check that the "document.webkit.messageHandlers.msg" namespace still exists. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers.msg ? 'y' : 'n';", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "y"); > > // Check that the "document.webkit.messageHandlers.anotherHandler" namespace exists. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers.anotherHandler ? 'y' : 'n';", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "y"); > >@@ -344,11 +344,11 @@ static void testUserContentManagerScriptMessageReceived(UserScriptMessageTest* t > test->unregisterHandler("msg"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers.msg.postMessage('42');", &error.outPtr()); >- g_assert(!javascriptResult); >- g_assert(error.get()); >+ g_assert_null(javascriptResult); >+ g_assert_nonnull(error.get()); > > // Re-registering a handler that has been unregistered must work >- g_assert(test->registerHandler("msg")); >+ g_assert_true(test->registerHandler("msg")); > valueString.reset(WebViewTest::javascriptResultToCString(test->postMessageAndWaitUntilReceived("msg", "'handler: msg'"))); > g_assert_cmpstr(valueString.get(), ==, "handler: msg"); > >@@ -357,7 +357,7 @@ static void testUserContentManagerScriptMessageReceived(UserScriptMessageTest* t > > static void testUserContentManagerScriptMessageInWorldReceived(UserScriptMessageTest* test, gconstpointer) > { >- g_assert(test->registerHandler("msg")); >+ g_assert_true(test->registerHandler("msg")); > > test->loadHtml("<html></html>", nullptr); > test->waitUntilLoadFinished(); >@@ -365,16 +365,16 @@ static void testUserContentManagerScriptMessageInWorldReceived(UserScriptMessage > // Check that the "window.webkit.messageHandlers" namespace doesn't exist in isolated worlds. > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptInWorldAndWaitUntilFinished("window.webkit.messageHandlers ? 'y' : 'n';", "WebExtensionTestScriptWorld", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > test->unregisterHandler("msg"); > >- g_assert(test->registerHandler("msg", "WebExtensionTestScriptWorld")); >+ g_assert_true(test->registerHandler("msg", "WebExtensionTestScriptWorld")); > > // Check that the "window.webkit.messageHandlers" namespace exists in the world. > javascriptResult = test->runJavaScriptInWorldAndWaitUntilFinished("window.webkit.messageHandlers ? 'y' : 'n';", "WebExtensionTestScriptWorld", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "y"); > >@@ -383,7 +383,7 @@ static void testUserContentManagerScriptMessageInWorldReceived(UserScriptMessage > > // Post message in main world should fail. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.webkit.messageHandlers.msg.postMessage('42');", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > > test->unregisterHandler("msg", "WebExtensionTestScriptWorld"); >@@ -392,11 +392,11 @@ static void testUserContentManagerScriptMessageInWorldReceived(UserScriptMessage > #if PLATFORM(GTK) > static void testUserContentManagerScriptMessageFromDOMBindings(UserScriptMessageTest* test, gconstpointer) > { >- g_assert(test->registerHandler("dom")); >+ g_assert_true(test->registerHandler("dom")); > > test->loadHtml("<html>1</html>", nullptr); > WebKitJavascriptResult* javascriptResult = test->waitUntilMessageReceived("dom"); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "DocumentLoaded"); > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp >index d4144f6982e330ef6bfd8ca9e105b1eda0e74e78..4c4345ed36d3c3b113b3318dc23c3a692ecaed0f 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp >@@ -34,46 +34,46 @@ static WebKitTestServer* kServer; > static void testWebContextDefault(Test* test, gconstpointer) > { > // Check there's a single instance of the default web context. >- g_assert(webkit_web_context_get_default() == webkit_web_context_get_default()); >- g_assert(webkit_web_context_get_default() != test->m_webContext.get()); >+ g_assert_cmphex(webkit_web_context_get_default(), ==, webkit_web_context_get_default()); >+ g_assert_cmphex(webkit_web_context_get_default(), !=, test->m_webContext.get()); > } > > static void testWebContextEphemeral(Test* test, gconstpointer) > { > // By default web contexts are not ephemeral. >- g_assert(!webkit_web_context_is_ephemeral(webkit_web_context_get_default())); >- g_assert(!webkit_web_context_is_ephemeral(test->m_webContext.get())); >+ g_assert_false(webkit_web_context_is_ephemeral(webkit_web_context_get_default())); >+ g_assert_false(webkit_web_context_is_ephemeral(test->m_webContext.get())); > > WebKitWebsiteDataManager* manager = webkit_web_context_get_website_data_manager(webkit_web_context_get_default()); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >- g_assert(!webkit_website_data_manager_is_ephemeral(manager)); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >+ g_assert_false(webkit_website_data_manager_is_ephemeral(manager)); > manager = webkit_web_context_get_website_data_manager(test->m_webContext.get()); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >- g_assert(!webkit_website_data_manager_is_ephemeral(manager)); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >+ g_assert_false(webkit_website_data_manager_is_ephemeral(manager)); > > auto webView = Test::adoptView(Test::createWebView()); >- g_assert(!webkit_web_view_is_ephemeral(webView.get())); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) == webkit_web_context_get_website_data_manager(webkit_web_context_get_default())); >+ g_assert_false(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), ==, webkit_web_context_get_website_data_manager(webkit_web_context_get_default())); > > webView = Test::adoptView(Test::createWebView(test->m_webContext.get())); >- g_assert(!webkit_web_view_is_ephemeral(webView.get())); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) == manager); >+ g_assert_false(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), ==, manager); > > GRefPtr<WebKitWebContext> context = adoptGRef(webkit_web_context_new_ephemeral()); >- g_assert(webkit_web_context_is_ephemeral(context.get())); >+ g_assert_true(webkit_web_context_is_ephemeral(context.get())); > manager = webkit_web_context_get_website_data_manager(context.get()); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >- g_assert(webkit_website_data_manager_is_ephemeral(manager)); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) != manager); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >+ g_assert_true(webkit_website_data_manager_is_ephemeral(manager)); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), !=, manager); > > webView = Test::adoptView(Test::createWebView(context.get())); >- g_assert(webkit_web_view_is_ephemeral(webView.get())); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) == manager); >+ g_assert_true(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), ==, manager); > > GRefPtr<WebKitWebsiteDataManager> ephemeralManager = adoptGRef(webkit_website_data_manager_new_ephemeral()); >- g_assert(webkit_website_data_manager_is_ephemeral(ephemeralManager.get())); >+ g_assert_true(webkit_website_data_manager_is_ephemeral(ephemeralManager.get())); > context = adoptGRef(webkit_web_context_new_with_website_data_manager(ephemeralManager.get())); >- g_assert(webkit_web_context_is_ephemeral(context.get())); >+ g_assert_true(webkit_web_context_is_ephemeral(context.get())); > } > > #if ENABLE(NETSCAPE_PLUGIN_API) >@@ -115,7 +115,7 @@ public: > static void testWebContextGetPlugins(PluginsTest* test, gconstpointer) > { > GList* plugins = test->getPlugins(); >- g_assert(plugins); >+ g_assert_nonnull(plugins); > > GRefPtr<WebKitPlugin> testPlugin; > for (GList* item = plugins; item; item = g_list_next(item)) { >@@ -126,22 +126,22 @@ static void testWebContextGetPlugins(PluginsTest* test, gconstpointer) > break; > } > } >- g_assert(WEBKIT_IS_PLUGIN(testPlugin.get())); >+ g_assert_true(WEBKIT_IS_PLUGIN(testPlugin.get())); > > char normalizedPath[PATH_MAX]; >- g_assert(realpath(WEBKIT_TEST_PLUGIN_DIR, normalizedPath)); >+ g_assert_nonnull(realpath(WEBKIT_TEST_PLUGIN_DIR, normalizedPath)); > GUniquePtr<char> pluginPath(g_build_filename(normalizedPath, "libTestNetscapePlugIn.so", nullptr)); > g_assert_cmpstr(webkit_plugin_get_path(testPlugin.get()), ==, pluginPath.get()); > g_assert_cmpstr(webkit_plugin_get_description(testPlugin.get()), ==, "Simple Netscape® plug-in that handles test content for WebKit"); > GList* mimeInfoList = webkit_plugin_get_mime_info_list(testPlugin.get()); >- g_assert(mimeInfoList); >+ g_assert_nonnull(mimeInfoList); > g_assert_cmpuint(g_list_length(mimeInfoList), ==, 2); > > WebKitMimeInfo* mimeInfo = static_cast<WebKitMimeInfo*>(mimeInfoList->data); > g_assert_cmpstr(webkit_mime_info_get_mime_type(mimeInfo), ==, "image/png"); > g_assert_cmpstr(webkit_mime_info_get_description(mimeInfo), ==, "png image"); > const gchar* const* extensions = webkit_mime_info_get_extensions(mimeInfo); >- g_assert(extensions); >+ g_assert_nonnull(extensions); > g_assert_cmpstr(extensions[0], ==, "png"); > > mimeInfoList = g_list_next(mimeInfoList); >@@ -149,7 +149,7 @@ static void testWebContextGetPlugins(PluginsTest* test, gconstpointer) > g_assert_cmpstr(webkit_mime_info_get_mime_type(mimeInfo), ==, "application/x-webkit-test-netscape"); > g_assert_cmpstr(webkit_mime_info_get_description(mimeInfo), ==, "test netscape content"); > extensions = webkit_mime_info_get_extensions(mimeInfo); >- g_assert(extensions); >+ g_assert_nonnull(extensions); > g_assert_cmpstr(extensions[0], ==, "testnetscape"); > } > #endif // ENABLE(NETSCAPE_PLUGIN_API) >@@ -191,11 +191,11 @@ public: > test->m_uriSchemeRequest = request; > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > >- g_assert(webkit_uri_scheme_request_get_web_view(request) == test->m_webView); >+ g_assert_cmphex(webkit_uri_scheme_request_get_web_view(request), ==, test->m_webView); > > const char* scheme = webkit_uri_scheme_request_get_scheme(request); >- g_assert(scheme); >- g_assert(test->m_handlersMap.contains(String::fromUTF8(scheme))); >+ g_assert_nonnull(scheme); >+ g_assert_true(test->m_handlersMap.contains(String::fromUTF8(scheme))); > > const URISchemeHandler& handler = test->m_handlersMap.get(String::fromUTF8(scheme)); > >@@ -297,7 +297,7 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) > size_t mainResourceDataSize = 0; > const char* mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, strlen(kBarHTML)); >- g_assert(!strncmp(mainResourceData, kBarHTML, mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, kBarHTML, mainResourceDataSize), ==, 0); > > test->registerURISchemeHandler("echo", kEchoHTMLFormat, -1, "text/html"); > test->loadURI("echo:hello-world"); >@@ -306,7 +306,7 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) > mainResourceDataSize = 0; > mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, strlen(echoHTML.get())); >- g_assert(!strncmp(mainResourceData, echoHTML.get(), mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, echoHTML.get(), mainResourceDataSize), ==, 0); > > test->loadURI("echo:with#fragment"); > test->waitUntilLoadFinished(); >@@ -316,20 +316,20 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) > mainResourceDataSize = 0; > mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpint(mainResourceDataSize, ==, strlen(echoHTML.get())); >- g_assert(!strncmp(mainResourceData, echoHTML.get(), mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, echoHTML.get(), mainResourceDataSize), ==, 0); > > test->registerURISchemeHandler("nomime", kBarHTML, -1, 0); > test->m_loadEvents.clear(); > test->loadURI("nomime:foo-bar"); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); > > test->registerURISchemeHandler("empty", 0, 0, "text/html"); > test->m_loadEvents.clear(); > test->loadURI("empty:nothing"); > test->waitUntilLoadFinished(); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::LoadFailed)); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::LoadFailed)); > > // Anything over 8192 bytes will get multiple calls to g_input_stream_read_async in > // WebKitURISchemeRequest when reading data, but we still need way more than that to >@@ -339,25 +339,25 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) > test->m_loadEvents.clear(); > test->loadURI("error:error"); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_true(test->m_loadFailed); > g_assert_error(test->m_error.get(), g_quark_from_string(errorDomain), errorCode); > g_assert_cmpstr(test->m_error->message, ==, genericErrorMessage); > > test->m_loadEvents.clear(); > test->loadURI("error:before-response"); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_true(test->m_loadFailed); > g_assert_error(test->m_error.get(), g_quark_from_string(errorDomain), errorCode); > g_assert_cmpstr(test->m_error->message, ==, beforeReceiveResponseErrorMessage); > > test->m_loadEvents.clear(); > test->loadURI("error:after-first-chunk"); > test->finishOnCommittedAndWaitUntilLoadFinished(); >- g_assert(!test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::LoadFailed)); >- g_assert(test->m_loadFailed); >+ g_assert_false(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::LoadFailed)); >+ g_assert_true(test->m_loadFailed); > g_assert_error(test->m_error.get(), g_quark_from_string(errorDomain), errorCode); > g_assert_cmpstr(test->m_error->message, ==, afterInitialChunkErrorMessage); > >@@ -365,8 +365,8 @@ static void testWebContextURIScheme(URISchemeTest* test, gconstpointer) > test->m_loadEvents.clear(); > test->loadURI("closed:input-stream"); > test->waitUntilLoadFinished(); >- g_assert(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >- g_assert(test->m_loadFailed); >+ g_assert_true(test->m_loadEvents.contains(LoadTrackingTest::ProvisionalLoadFailed)); >+ g_assert_true(test->m_loadFailed); > g_assert_error(test->m_error.get(), G_IO_ERROR, G_IO_ERROR_CLOSED); > } > >@@ -377,7 +377,7 @@ static void testWebContextSpellChecker(Test* test, gconstpointer) > > // Check what happens if no spell checking language has been set. > const gchar* const* currentLanguage = webkit_web_context_get_spell_checking_languages(webContext); >- g_assert(!currentLanguage); >+ g_assert_null(currentLanguage); > > // Set the language to a specific one. > GRefPtr<GPtrArray> languages = adoptGRef(g_ptr_array_new()); >@@ -415,13 +415,13 @@ static void testWebContextSpellChecker(Test* test, gconstpointer) > g_ptr_array_add(languages.get(), 0); > webkit_web_context_set_spell_checking_languages(webContext, reinterpret_cast<const char* const*>(languages->pdata)); > currentLanguage = webkit_web_context_get_spell_checking_languages(webContext); >- g_assert(!currentLanguage); >+ g_assert_null(currentLanguage); > > // Check disabling and re-enabling spell checking. > webkit_web_context_set_spell_checking_enabled(webContext, FALSE); >- g_assert(!webkit_web_context_get_spell_checking_enabled(webContext)); >+ g_assert_false(webkit_web_context_get_spell_checking_enabled(webContext)); > webkit_web_context_set_spell_checking_enabled(webContext, TRUE); >- g_assert(webkit_web_context_get_spell_checking_enabled(webContext)); >+ g_assert_true(webkit_web_context_get_spell_checking_enabled(webContext)); > } > #endif // PLATFORM(GTK) > >@@ -433,7 +433,7 @@ static void testWebContextLanguages(WebViewTest* test, gconstpointer) > size_t mainResourceDataSize = 0; > const char* mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpuint(mainResourceDataSize, ==, strlen(expectedDefaultLanguage)); >- g_assert(!strncmp(mainResourceData, expectedDefaultLanguage, mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, expectedDefaultLanguage, mainResourceDataSize), ==, 0); > > GRefPtr<GPtrArray> languages = adoptGRef(g_ptr_array_new()); > g_ptr_array_add(languages.get(), const_cast<gpointer>(static_cast<const void*>("en"))); >@@ -448,15 +448,15 @@ static void testWebContextLanguages(WebViewTest* test, gconstpointer) > mainResourceDataSize = 0; > mainResourceData = test->mainResourceData(mainResourceDataSize); > g_assert_cmpuint(mainResourceDataSize, ==, strlen(expectedLanguages)); >- g_assert(!strncmp(mainResourceData, expectedLanguages, mainResourceDataSize)); >+ g_assert_cmpint(strncmp(mainResourceData, expectedLanguages, mainResourceDataSize), ==, 0); > > // When using the C locale, en-US should be used as default. > const char* cLanguage[] = { "C", nullptr }; > webkit_web_context_set_preferred_languages(test->m_webContext.get(), cLanguage); > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("Intl.DateTimeFormat().resolvedOptions().locale", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> locale(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(locale.get(), ==, expectedDefaultLanguage); > >@@ -464,8 +464,8 @@ static void testWebContextLanguages(WebViewTest* test, gconstpointer) > const char* posixLanguage[] = { "POSIX", nullptr }; > webkit_web_context_set_preferred_languages(test->m_webContext.get(), posixLanguage); > javascriptResult = test->runJavaScriptAndWaitUntilFinished("Intl.DateTimeFormat().resolvedOptions().locale", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > locale.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(locale.get(), ==, expectedDefaultLanguage); > >@@ -473,7 +473,7 @@ static void testWebContextLanguages(WebViewTest* test, gconstpointer) > const char* invalidLanguage[] = { "A", nullptr }; > webkit_web_context_set_preferred_languages(test->m_webContext.get(), invalidLanguage); > javascriptResult = test->runJavaScriptAndWaitUntilFinished("Intl.DateTimeFormat().resolvedOptions().locale", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_nonnull(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > } > >@@ -524,29 +524,29 @@ public: > void verifyThatSchemeMatchesPolicy(const char* scheme, unsigned policy) > { > if (policy & Local) >- g_assert(webkit_security_manager_uri_scheme_is_local(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_local(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_local(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_local(m_manager, scheme)); > if (policy & NoAccess) >- g_assert(webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_no_access(m_manager, scheme)); > if (policy & DisplayIsolated) >- g_assert(webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_display_isolated(m_manager, scheme)); > if (policy & Secure) >- g_assert(webkit_security_manager_uri_scheme_is_secure(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_secure(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_secure(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_secure(m_manager, scheme)); > if (policy & CORSEnabled) >- g_assert(webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_cors_enabled(m_manager, scheme)); > if (policy & EmptyDocument) >- g_assert(webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme)); >+ g_assert_true(webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme)); > else >- g_assert(!webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme)); >+ g_assert_false(webkit_security_manager_uri_scheme_is_empty_document(m_manager, scheme)); > } > > WebKitSecurityManager* m_manager; >@@ -582,8 +582,8 @@ static void testWebContextSecurityPolicy(SecurityPolicyTest* test, gconstpointer > > static void consoleMessageReceivedCallback(WebKitUserContentManager*, WebKitJavascriptResult* message, Vector<WebKitJavascriptResult*>* result) > { >- g_assert(message); >- g_assert(result); >+ g_assert_nonnull(message); >+ g_assert_nonnull(result); > result->append(webkit_javascript_result_ref(message)); > } > >@@ -603,18 +603,18 @@ static void testWebContextSecurityFileXHR(WebViewTest* test, gconstpointer) > // By default file access is not allowed, this will show a console message with a cross-origin error. > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished(xhr.get(), &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > g_assert_cmpuint(consoleMessages.size(), ==, 2); > Vector<GUniquePtr<char>, 2> expectedMessages; > expectedMessages.append(g_strdup("Cross origin requests are only supported for HTTP.")); > expectedMessages.append(g_strdup_printf("XMLHttpRequest cannot load %s due to access control checks.", jsonURL.get())); > unsigned i = 0; > for (auto* consoleMessage : consoleMessages) { >- g_assert(consoleMessage); >+ g_assert_nonnull(consoleMessage); > GUniquePtr<char> messageString(WebViewTest::javascriptResultToCString(consoleMessage)); > GRefPtr<GVariant> variant = g_variant_parse(G_VARIANT_TYPE("(uusus)"), messageString.get(), nullptr, nullptr, nullptr); >- g_assert(variant.get()); >+ g_assert_nonnull(variant.get()); > unsigned level; > const char* messageText; > g_variant_get(variant.get(), "(uu&su&s)", nullptr, &level, &messageText, nullptr, nullptr); >@@ -629,21 +629,21 @@ static void testWebContextSecurityFileXHR(WebViewTest* test, gconstpointer) > test->loadURI(fileURL.get()); > test->waitUntilLoadFinished(); > javascriptResult = test->runJavaScriptAndWaitUntilFinished(xhr.get(), &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > > // It isn't still possible to load file from an HTTP URL. > test->loadURI(kServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); > javascriptResult = test->runJavaScriptAndWaitUntilFinished(xhr.get(), &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > i = 0; > for (auto* consoleMessage : consoleMessages) { >- g_assert(consoleMessage); >+ g_assert_nonnull(consoleMessage); > GUniquePtr<char> messageString(WebViewTest::javascriptResultToCString(consoleMessage)); > GRefPtr<GVariant> variant = g_variant_parse(G_VARIANT_TYPE("(uusus)"), messageString.get(), nullptr, nullptr, nullptr); >- g_assert(variant.get()); >+ g_assert_nonnull(variant.get()); > unsigned level; > const char* messageText; > g_variant_get(variant.get(), "(uu&su&s)", nullptr, &level, &messageText, nullptr, nullptr); >@@ -684,10 +684,10 @@ public: > // actually a proxy server. We're testing whether the proxy settings > // work, not whether we can write a soup proxy server. > m_proxyServer.run(serverCallback); >- g_assert(m_proxyServer.baseURI()); >+ g_assert_nonnull(m_proxyServer.baseURI()); > #if SOUP_CHECK_VERSION(2, 61, 90) > m_proxyServer.addWebSocketHandler(webSocketProxyServerCallback, this); >- g_assert(m_proxyServer.baseWebSocketURI()); >+ g_assert_nonnull(m_proxyServer.baseWebSocketURI()); > #endif > } > >@@ -756,7 +756,7 @@ static void testWebContextProxySettings(ProxyTest* test, gconstpointer) > // WebSocket requests should also be received by kServer. > kServer->addWebSocketHandler(webSocketServerCallback, test); > auto serverType = test->createWebSocketAndWaitUntilConnected(); >- g_assert(serverType == ProxyTest::WebSocketServerType::NoProxy); >+ g_assert_true(serverType == ProxyTest::WebSocketServerType::NoProxy); > #endif > > // Set default proxy URI to point to proxyServer. Requests to kServer should be received by proxyServer instead. >@@ -771,7 +771,7 @@ static void testWebContextProxySettings(ProxyTest* test, gconstpointer) > #if SOUP_CHECK_VERSION(2, 61, 90) > // WebSocket requests should also be received by proxyServer. > serverType = test->createWebSocketAndWaitUntilConnected(); >- g_assert(serverType == ProxyTest::WebSocketServerType::Proxy); >+ g_assert_true(serverType == ProxyTest::WebSocketServerType::Proxy); > #endif > > // Proxy settings also affect ephemeral web views. >@@ -782,18 +782,18 @@ static void testWebContextProxySettings(ProxyTest* test, gconstpointer) > "web-context", test->m_webContext.get(), > "is-ephemeral", TRUE, > nullptr)); >- g_assert(webkit_web_view_is_ephemeral(webView.get())); >- g_assert(!webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); >+ g_assert_true(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_false(webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); > > g_signal_connect(webView.get(), "load-changed", G_CALLBACK(ephemeralViewloadChanged), test); > webkit_web_view_load_uri(webView.get(), kServer->getURIForPath("/echoPort").data()); > g_main_loop_run(test->m_mainLoop); > WebKitWebResource* resource = webkit_web_view_get_main_resource(webView.get()); >- g_assert(WEBKIT_IS_WEB_RESOURCE(resource)); >+ g_assert_true(WEBKIT_IS_WEB_RESOURCE(resource)); > webkit_web_resource_get_data(resource, nullptr, [](GObject* object, GAsyncResult* result, gpointer userData) { > size_t dataSize; > GUniquePtr<char> data(reinterpret_cast<char*>(webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, nullptr))); >- g_assert(data); >+ g_assert_nonnull(data); > auto* test = static_cast<ProxyTest*>(userData); > GUniquePtr<char> proxyServerPortAsString = test->proxyServerPortAsString(); > ASSERT_CMP_CSTRING(CString(data.get(), dataSize), ==, proxyServerPortAsString.get()); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp >index d757341b0fba34f272f268d8d33396c77fe87005..ee00adb4fa6b70520d8674d4adac05a8d4160d38 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp >@@ -45,8 +45,8 @@ static WebKitTestServer* gServer; > > static void testWebViewWebContext(WebViewTest* test, gconstpointer) > { >- g_assert(webkit_web_view_get_context(test->m_webView) == test->m_webContext.get()); >- g_assert(webkit_web_context_get_default() != test->m_webContext.get()); >+ g_assert_cmphex(webkit_web_view_get_context(test->m_webView), ==, test->m_webContext.get()); >+ g_assert_cmphex(webkit_web_context_get_default(), !=, test->m_webContext.get()); > > // Check that a web view created with g_object_new has the default context. > auto webView = Test::adoptView(g_object_new(WEBKIT_TYPE_WEB_VIEW, >@@ -54,11 +54,11 @@ static void testWebViewWebContext(WebViewTest* test, gconstpointer) > "backend", Test::createWebViewBackend(), > #endif > nullptr)); >- g_assert(webkit_web_view_get_context(webView.get()) == webkit_web_context_get_default()); >+ g_assert_cmphex(webkit_web_view_get_context(webView.get()), ==, webkit_web_context_get_default()); > > // Check that a web view created with a related view has the related view context. > webView = Test::adoptView(Test::createWebView(test->m_webView)); >- g_assert(webkit_web_view_get_context(webView.get()) == test->m_webContext.get()); >+ g_assert_cmphex(webkit_web_view_get_context(webView.get()), ==, test->m_webContext.get()); > > // Check that a web context given as construct parameter is ignored if a related view is also provided. > webView = Test::adoptView(g_object_new(WEBKIT_TYPE_WEB_VIEW, >@@ -68,7 +68,7 @@ static void testWebViewWebContext(WebViewTest* test, gconstpointer) > "web-context", webkit_web_context_get_default(), > "related-view", test->m_webView, > nullptr)); >- g_assert(webkit_web_view_get_context(webView.get()) == test->m_webContext.get()); >+ g_assert_cmphex(webkit_web_view_get_context(webView.get()), ==, test->m_webContext.get()); > } > > static void testWebViewWebContextLifetime(WebViewTest* test, gconstpointer) >@@ -140,9 +140,9 @@ static void testWebViewWebBackend(Test* test, gconstpointer) > GRefPtr<WebKitWebView> webView = adoptGRef(webkit_web_view_new(webkit_web_view_backend_new(wpe_view_backend_create_with_backend_interface(&s_testingInterface, nullptr), nullptr, nullptr))); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView.get())); > auto* viewBackend = webkit_web_view_get_backend(webView.get()); >- g_assert(viewBackend); >+ g_assert_nonnull(viewBackend); > auto* wpeBackend = webkit_web_view_backend_get_wpe_backend(viewBackend); >- g_assert(wpeBackend); >+ g_assert_nonnull(wpeBackend); > webView = nullptr; > > // User provided backend with destroy notify. >@@ -154,7 +154,7 @@ static void testWebViewWebBackend(Test* test, gconstpointer) > }, &wpeBackend))); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView.get())); > webView = nullptr; >- g_assert(!wpeBackend); >+ g_assert_null(wpeBackend); > > // User provided backend owned by another object with destroy notify. > static bool hasInstance = false; >@@ -174,14 +174,14 @@ static void testWebViewWebBackend(Test* test, gconstpointer) > struct wpe_view_backend* backend; > }; > auto* owner = new BackendOwner(wpe_view_backend_create_with_backend_interface(&s_testingInterface, nullptr)); >- g_assert(hasInstance); >+ g_assert_true(hasInstance); > webView = adoptGRef(webkit_web_view_new(webkit_web_view_backend_new(owner->backend, [](gpointer userData) { > delete static_cast<BackendOwner*>(userData); > }, owner))); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView.get())); >- g_assert(hasInstance); >+ g_assert_true(hasInstance); > webView = nullptr; >- g_assert(!hasInstance); >+ g_assert_false(hasInstance); > } > #endif // PLATFORM(WPE) > >@@ -195,11 +195,11 @@ static void ephemeralViewloadChanged(WebKitWebView* webView, WebKitLoadEvent loa > > static void testWebViewEphemeral(WebViewTest* test, gconstpointer) > { >- g_assert(!webkit_web_view_is_ephemeral(test->m_webView)); >- g_assert(!webkit_web_context_is_ephemeral(webkit_web_view_get_context(test->m_webView))); >+ g_assert_false(webkit_web_view_is_ephemeral(test->m_webView)); >+ g_assert_false(webkit_web_context_is_ephemeral(webkit_web_view_get_context(test->m_webView))); > auto* manager = webkit_web_context_get_website_data_manager(test->m_webContext.get()); >- g_assert(!webkit_website_data_manager_is_ephemeral(manager)); >- g_assert(webkit_web_view_get_website_data_manager(test->m_webView) == manager); >+ g_assert_false(webkit_website_data_manager_is_ephemeral(manager)); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(test->m_webView), ==, manager); > webkit_website_data_manager_clear(manager, WEBKIT_WEBSITE_DATA_DISK_CACHE, 0, nullptr, [](GObject* manager, GAsyncResult* result, gpointer userData) { > webkit_website_data_manager_clear_finish(WEBKIT_WEBSITE_DATA_MANAGER(manager), result, nullptr); > static_cast<WebViewTest*>(userData)->quitMainLoop(); >@@ -214,9 +214,9 @@ static void testWebViewEphemeral(WebViewTest* test, gconstpointer) > "web-context", webkit_web_view_get_context(test->m_webView), > "is-ephemeral", TRUE, > nullptr)); >- g_assert(webkit_web_view_is_ephemeral(webView.get())); >- g_assert(!webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) != manager); >+ g_assert_true(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_false(webkit_web_context_is_ephemeral(webkit_web_view_get_context(webView.get()))); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), !=, manager); > > g_signal_connect(webView.get(), "load-changed", G_CALLBACK(ephemeralViewloadChanged), test); > webkit_web_view_load_uri(webView.get(), gServer->getURIForPath("/").data()); >@@ -229,7 +229,7 @@ static void testWebViewEphemeral(WebViewTest* test, gconstpointer) > > webkit_website_data_manager_fetch(manager, WEBKIT_WEBSITE_DATA_DISK_CACHE, nullptr, [](GObject* manager, GAsyncResult* result, gpointer userData) { > auto* test = static_cast<WebViewTest*>(userData); >- g_assert(!webkit_website_data_manager_fetch_finish(WEBKIT_WEBSITE_DATA_MANAGER(manager), result, nullptr)); >+ g_assert_null(webkit_website_data_manager_fetch_finish(WEBKIT_WEBSITE_DATA_MANAGER(manager), result, nullptr)); > test->quitMainLoop(); > }, test); > g_main_loop_run(test->m_mainLoop); >@@ -239,7 +239,7 @@ static void testWebViewCustomCharset(WebViewTest* test, gconstpointer) > { > test->loadURI(gServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); >+ g_assert_null(webkit_web_view_get_custom_charset(test->m_webView)); > webkit_web_view_set_custom_charset(test->m_webView, "utf8"); > // Changing the charset reloads the page, so wait until reloaded. > test->waitUntilLoadFinished(); >@@ -248,15 +248,15 @@ static void testWebViewCustomCharset(WebViewTest* test, gconstpointer) > // Go back to the default charset and wait until reloaded. > webkit_web_view_set_custom_charset(test->m_webView, nullptr); > test->waitUntilLoadFinished(); >- g_assert(!webkit_web_view_get_custom_charset(test->m_webView)); >+ g_assert_null(webkit_web_view_get_custom_charset(test->m_webView)); > } > > static void testWebViewSettings(WebViewTest* test, gconstpointer) > { > WebKitSettings* defaultSettings = webkit_web_view_get_settings(test->m_webView); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(defaultSettings)); >- g_assert(defaultSettings); >- g_assert(webkit_settings_get_enable_javascript(defaultSettings)); >+ g_assert_nonnull(defaultSettings); >+ g_assert_true(webkit_settings_get_enable_javascript(defaultSettings)); > > GRefPtr<WebKitSettings> newSettings = adoptGRef(webkit_settings_new()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(newSettings.get())); >@@ -264,24 +264,24 @@ static void testWebViewSettings(WebViewTest* test, gconstpointer) > webkit_web_view_set_settings(test->m_webView, newSettings.get()); > > WebKitSettings* settings = webkit_web_view_get_settings(test->m_webView); >- g_assert(settings != defaultSettings); >- g_assert(!webkit_settings_get_enable_javascript(settings)); >+ g_assert_cmphex(settings, !=, defaultSettings); >+ g_assert_false(webkit_settings_get_enable_javascript(settings)); > > auto webView2 = Test::adoptView(Test::createWebView()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView2.get())); > webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView2.get()), settings); >- g_assert(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView2.get())) == settings); >+ g_assert_cmphex(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView2.get())), ==, settings); > > GRefPtr<WebKitSettings> newSettings2 = adoptGRef(webkit_settings_new()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(newSettings2.get())); > webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webView2.get()), newSettings2.get()); > settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView2.get())); >- g_assert(settings == newSettings2.get()); >- g_assert(webkit_settings_get_enable_javascript(settings)); >+ g_assert_cmphex(settings, ==, newSettings2.get()); >+ g_assert_true(webkit_settings_get_enable_javascript(settings)); > > auto webView3 = Test::adoptView(Test::createWebView(newSettings2.get())); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webView3.get())); >- g_assert(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView3.get())) == newSettings2.get()); >+ g_assert_cmphex(webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webView3.get())), ==, newSettings2.get()); > } > > static void testWebViewZoomLevel(WebViewTest* test, gconstpointer) >@@ -303,98 +303,98 @@ static void testWebViewRunJavaScript(WebViewTest* test, gconstpointer) > > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').title;", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Title"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').href;", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "http://www.webkitgtk.org/"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("window.document.getElementById('WebKitLink').textContent", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Website"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = 25;", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(javascriptResult), ==, 25); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = 2.5;", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(javascriptResult), ==, 2.5); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = true", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >- g_assert(WebViewTest::javascriptResultToBoolean(javascriptResult)); >+ g_assert_no_error(error.get()); >+ g_assert_true(WebViewTest::javascriptResultToBoolean(javascriptResult)); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = false", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >- g_assert(!WebViewTest::javascriptResultToBoolean(javascriptResult)); >+ g_assert_no_error(error.get()); >+ g_assert_false(WebViewTest::javascriptResultToBoolean(javascriptResult)); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a = null", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >- g_assert(WebViewTest::javascriptResultIsNull(javascriptResult)); >+ g_assert_no_error(error.get()); >+ g_assert_true(WebViewTest::javascriptResultIsNull(javascriptResult)); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("function Foo() { a = 25; } Foo();", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >- g_assert(WebViewTest::javascriptResultIsUndefined(javascriptResult)); >+ g_assert_no_error(error.get()); >+ g_assert_true(WebViewTest::javascriptResultIsUndefined(javascriptResult)); > > javascriptResult = test->runJavaScriptFromGResourceAndWaitUntilFinished("/org/webkit/glib/tests/link-title.js", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "WebKitGTK+ Title"); > > javascriptResult = test->runJavaScriptFromGResourceAndWaitUntilFinished("/wrong/path/to/resource.js", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("foo();", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > > // Values of the main world are not available in the isolated one. > javascriptResult = test->runJavaScriptInWorldAndWaitUntilFinished("a", "WebExtensionTestScriptWorld", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > > javascriptResult = test->runJavaScriptInWorldAndWaitUntilFinished("a = 50", "WebExtensionTestScriptWorld", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(javascriptResult), ==, 50); > > // Values of the isolated world are not available in the normal one. > javascriptResult = test->runJavaScriptAndWaitUntilFinished("a", &error.outPtr()); >- g_assert(javascriptResult); >+ g_assert_nonnull(javascriptResult); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_javascript_result_get_js_value(javascriptResult))); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(javascriptResult), ==, 25); > > // Running a script in a world that doesn't exist should fail. > javascriptResult = test->runJavaScriptInWorldAndWaitUntilFinished("a", "InvalidScriptWorld", &error.outPtr()); >- g_assert(!javascriptResult); >+ g_assert_null(javascriptResult); > g_assert_error(error.get(), WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED); > } > >@@ -479,21 +479,21 @@ static void testWebViewFullScreen(FullScreenClientTest* test, gconstpointer) > static void testWebViewCanShowMIMEType(WebViewTest* test, gconstpointer) > { > // Supported MIME types. >- g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "text/html")); >- g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "text/plain")); >- g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "image/jpeg")); >+ g_assert_true(webkit_web_view_can_show_mime_type(test->m_webView, "text/html")); >+ g_assert_true(webkit_web_view_can_show_mime_type(test->m_webView, "text/plain")); >+ g_assert_true(webkit_web_view_can_show_mime_type(test->m_webView, "image/jpeg")); > > // Unsupported MIME types. >- g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "text/vcard")); >- g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/zip")); >- g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/octet-stream")); >+ g_assert_false(webkit_web_view_can_show_mime_type(test->m_webView, "text/vcard")); >+ g_assert_false(webkit_web_view_can_show_mime_type(test->m_webView, "application/zip")); >+ g_assert_false(webkit_web_view_can_show_mime_type(test->m_webView, "application/octet-stream")); > > #if ENABLE(NETSCAPE_PLUGIN_API) > // Plugins are only supported when enabled. > webkit_web_context_set_additional_plugins_directory(webkit_web_view_get_context(test->m_webView), WEBKIT_TEST_PLUGIN_DIR); >- g_assert(webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape")); >+ g_assert_true(webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape")); > webkit_settings_set_enable_plugins(webkit_web_view_get_settings(test->m_webView), FALSE); >- g_assert(!webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape")); >+ g_assert_false(webkit_web_view_can_show_mime_type(test->m_webView, "application/x-webkit-test-netscape")); > #endif > } > >@@ -591,7 +591,7 @@ static void testWebViewSubmitForm(FormClientTest* test, gconstpointer) > > test->submitFormAtPosition(5, 5); > GHashTable* tableValues = test->getTextFieldsAsHashTable(); >- g_assert(tableValues); >+ g_assert_nonnull(tableValues); > g_assert_cmpuint(g_hash_table_size(tableValues), ==, 4); > g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "text1")), ==, "value1"); > g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "")), ==, "value3"); >@@ -599,7 +599,7 @@ static void testWebViewSubmitForm(FormClientTest* test, gconstpointer) > g_assert_cmpstr(static_cast<char*>(g_hash_table_lookup(tableValues, "password")), ==, "secret"); > > GPtrArray* names = test->getTextFieldNames(); >- g_assert(names); >+ g_assert_nonnull(names); > g_assert_cmpuint(names->len, ==, 5); > g_assert_cmpstr(static_cast<char*>(names->pdata[0]), ==, "text1"); > g_assert_cmpstr(static_cast<char*>(names->pdata[1]), ==, "text2"); >@@ -608,7 +608,7 @@ static void testWebViewSubmitForm(FormClientTest* test, gconstpointer) > g_assert_cmpstr(static_cast<char*>(names->pdata[4]), ==, "password"); > > GPtrArray* values = test->getTextFieldValues(); >- g_assert(values); >+ g_assert_nonnull(values); > g_assert_cmpuint(values->len, ==, 5); > g_assert_cmpstr(static_cast<char*>(values->pdata[0]), ==, "value1"); > g_assert_cmpstr(static_cast<char*>(values->pdata[1]), ==, "value2"); >@@ -643,8 +643,8 @@ public: > { > GUniqueOutPtr<GError> error; > test->m_inputStream = adoptGRef(webkit_web_view_save_finish(test->m_webView, result, &error.outPtr())); >- g_assert(G_IS_INPUT_STREAM(test->m_inputStream.get())); >- g_assert(!error); >+ g_assert_true(G_IS_INPUT_STREAM(test->m_inputStream.get())); >+ g_assert_no_error(error.get()); > > test->quitMainLoop(); > } >@@ -652,8 +652,8 @@ public: > static void webViewSavedToFileCallback(GObject* object, GAsyncResult* result, SaveWebViewTest* test) > { > GUniqueOutPtr<GError> error; >- g_assert(webkit_web_view_save_to_file_finish(test->m_webView, result, &error.outPtr())); >- g_assert(!error); >+ g_assert_true(webkit_web_view_save_to_file_finish(test->m_webView, result, &error.outPtr())); >+ g_assert_no_error(error.get()); > > test->quitMainLoop(); > } >@@ -705,7 +705,7 @@ static void testWebViewSave(SaveWebViewTest* test, gconstpointer) > gssize readBytes = 0; > gssize totalBytesFromStream = 0; > while ((readBytes = g_input_stream_read(test->m_inputStream.get(), &buffer, 512, 0, &error.outPtr()))) { >- g_assert(!error); >+ g_assert_no_error(error.get()); > totalBytesFromStream += readBytes; > } > >@@ -734,45 +734,45 @@ static void testWebViewPageVisibility(WebViewTest* test, gconstpointer) > > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> valueString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "prerender"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >- g_assert(WebViewTest::javascriptResultToBoolean(javascriptResult)); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); >+ g_assert_true(WebViewTest::javascriptResultToBoolean(javascriptResult)); > > // Show the page. The visibility should be updated to 'visible'. > test->showInWindow(); > test->waitUntilTitleChanged(); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "visible"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >- g_assert(!WebViewTest::javascriptResultToBoolean(javascriptResult)); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); >+ g_assert_false(WebViewTest::javascriptResultToBoolean(javascriptResult)); > > // Hide the page. The visibility should be updated to 'hidden'. > test->hideView(); > test->waitUntilTitleChanged(); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.visibilityState;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "hidden"); > > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.hidden;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >- g_assert(WebViewTest::javascriptResultToBoolean(javascriptResult)); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); >+ g_assert_true(WebViewTest::javascriptResultToBoolean(javascriptResult)); > } > > #if PLATFORM(GTK) >@@ -784,7 +784,7 @@ public: > { > GUniqueOutPtr<GError> error; > test->m_surface = webkit_web_view_get_snapshot_finish(web_view, res, &error.outPtr()); >- g_assert(!test->m_surface); >+ g_assert_null(test->m_surface); > g_assert_error(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED); > test->quitMainLoop(); > } >@@ -811,11 +811,11 @@ static void testWebViewSnapshot(SnapshotWebViewTest* test, gconstpointer) > > // WEBKIT_SNAPSHOT_REGION_VISIBLE returns a null surface when the view is not visible. > cairo_surface_t* surface1 = test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_VISIBLE, WEBKIT_SNAPSHOT_OPTIONS_NONE); >- g_assert(!surface1); >+ g_assert_null(surface1); > > // WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT works even if the window is not visible. > surface1 = test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_FULL_DOCUMENT, WEBKIT_SNAPSHOT_OPTIONS_NONE); >- g_assert(surface1); >+ g_assert_nonnull(surface1); > g_assert_cmpuint(cairo_surface_get_type(surface1), ==, CAIRO_SURFACE_TYPE_IMAGE); > g_assert_cmpint(cairo_image_surface_get_width(surface1), ==, 200); > g_assert_cmpint(cairo_image_surface_get_height(surface1), ==, 100); >@@ -823,7 +823,7 @@ static void testWebViewSnapshot(SnapshotWebViewTest* test, gconstpointer) > // Show the WebView in a popup widow of 50x50 and try again with WEBKIT_SNAPSHOT_REGION_VISIBLE. > test->showInWindowAndWaitUntilMapped(GTK_WINDOW_POPUP, 50, 50); > surface1 = cairo_surface_reference(test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_VISIBLE, WEBKIT_SNAPSHOT_OPTIONS_NONE)); >- g_assert(surface1); >+ g_assert_nonnull(surface1); > g_assert_cmpuint(cairo_surface_get_type(surface1), ==, CAIRO_SURFACE_TYPE_IMAGE); > g_assert_cmpint(cairo_image_surface_get_width(surface1), ==, 50); > g_assert_cmpint(cairo_image_surface_get_height(surface1), ==, 50); >@@ -831,8 +831,8 @@ static void testWebViewSnapshot(SnapshotWebViewTest* test, gconstpointer) > // Select all text in the WebView, request a snapshot ignoring selection. > test->selectAll(); > cairo_surface_t* surface2 = test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_VISIBLE, WEBKIT_SNAPSHOT_OPTIONS_NONE); >- g_assert(surface2); >- g_assert(Test::cairoSurfacesEqual(surface1, surface2)); >+ g_assert_nonnull(surface2); >+ g_assert_true(Test::cairoSurfacesEqual(surface1, surface2)); > > // Request a new snapshot, including the selection this time. The size should be the same but the result > // must be different to the one previously obtained. >@@ -840,18 +840,18 @@ static void testWebViewSnapshot(SnapshotWebViewTest* test, gconstpointer) > g_assert_cmpuint(cairo_surface_get_type(surface2), ==, CAIRO_SURFACE_TYPE_IMAGE); > g_assert_cmpint(cairo_image_surface_get_width(surface1), ==, cairo_image_surface_get_width(surface2)); > g_assert_cmpint(cairo_image_surface_get_height(surface1), ==, cairo_image_surface_get_height(surface2)); >- g_assert(!Test::cairoSurfacesEqual(surface1, surface2)); >+ g_assert_false(Test::cairoSurfacesEqual(surface1, surface2)); > > // Get a snpashot with a transparent background, the result must be different. > surface2 = test->getSnapshotAndWaitUntilReady(WEBKIT_SNAPSHOT_REGION_VISIBLE, WEBKIT_SNAPSHOT_OPTIONS_TRANSPARENT_BACKGROUND); > g_assert_cmpuint(cairo_surface_get_type(surface2), ==, CAIRO_SURFACE_TYPE_IMAGE); > g_assert_cmpint(cairo_image_surface_get_width(surface1), ==, cairo_image_surface_get_width(surface2)); > g_assert_cmpint(cairo_image_surface_get_height(surface1), ==, cairo_image_surface_get_height(surface2)); >- g_assert(!Test::cairoSurfacesEqual(surface1, surface2)); >+ g_assert_false(Test::cairoSurfacesEqual(surface1, surface2)); > cairo_surface_destroy(surface1); > > // Test that cancellation works. >- g_assert(test->getSnapshotAndCancel()); >+ g_assert_true(test->getSnapshotAndCancel()); > } > #endif // PLATFORM(GTK) > >@@ -882,8 +882,8 @@ public: > > static gboolean permissionRequestCallback(WebKitWebView*, WebKitPermissionRequest *request, NotificationWebViewTest* test) > { >- g_assert(WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request)); >- g_assert(test->m_isExpectingPermissionRequest); >+ g_assert_true(WEBKIT_IS_NOTIFICATION_PERMISSION_REQUEST(request)); >+ g_assert_true(test->m_isExpectingPermissionRequest); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request)); > > test->m_event = Permission; >@@ -897,7 +897,7 @@ public: > > static gboolean notificationClosedCallback(WebKitNotification* notification, NotificationWebViewTest* test) > { >- g_assert(test->m_notification == notification); >+ g_assert_cmphex(test->m_notification, ==, notification); > test->m_notification = nullptr; > test->m_event = Closed; > if (g_main_loop_is_running(test->m_mainLoop)) >@@ -907,14 +907,14 @@ public: > > static gboolean notificationClickedCallback(WebKitNotification* notification, NotificationWebViewTest* test) > { >- g_assert(test->m_notification == notification); >+ g_assert_cmphex(test->m_notification, ==, notification); > test->m_event = Clicked; > return TRUE; > } > > static gboolean showNotificationCallback(WebKitWebView*, WebKitNotification* notification, NotificationWebViewTest* test) > { >- g_assert(!test->m_notification); >+ g_assert_null(test->m_notification); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(notification)); > test->m_notification = notification; > g_signal_connect(notification, "closed", G_CALLBACK(notificationClosedCallback), test); >@@ -955,7 +955,7 @@ public: > bool hasPermission() > { > auto* result = runJavaScriptAndWaitUntilFinished("Notification.permission;", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > GUniquePtr<char> value(javascriptResultToCString(result)); > return !g_strcmp0(value.get(), "granted"); > } >@@ -993,7 +993,7 @@ public: > m_event = None; > runJavaScriptAndWaitUntilFinished("n.onclick = function() { window.webkit.messageHandlers.notifications.postMessage('clicked'); }", nullptr); > webkit_notification_clicked(m_notification); >- g_assert(m_event == Clicked); >+ g_assert_cmpint(m_event, ==, Clicked); > g_main_loop_run(m_mainLoop); > } > >@@ -1006,11 +1006,11 @@ public: > > void closeNotificationAndWaitUntilOnClosed() > { >- g_assert(m_notification); >+ g_assert_nonnull(m_notification); > m_event = None; > runJavaScriptAndWaitUntilFinished("n.onclose = function() { window.webkit.messageHandlers.notifications.postMessage('closed'); }", nullptr); > webkit_notification_close(m_notification); >- g_assert(m_event == Closed); >+ g_assert_cmpint(m_event, ==, Closed); > g_main_loop_run(m_mainLoop); > } > >@@ -1027,41 +1027,41 @@ static void testWebViewNotification(NotificationWebViewTest* test, gconstpointer > // Notifications don't work with local or special schemes. > test->loadURI(gServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(!test->hasPermission()); >+ g_assert_false(test->hasPermission()); > > test->requestPermissionAndWaitUntilGiven(); >- g_assert(test->m_event == NotificationWebViewTest::Permission); >- g_assert(test->hasPermission()); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Permission); >+ g_assert_true(test->hasPermission()); > > static const char* title = "This is a notification"; > static const char* body = "This is the body."; > static const char* tag = "This is the tag."; > test->requestNotificationAndWaitUntilShown(title, body, tag); > >- g_assert(test->m_event == NotificationWebViewTest::Shown); >- g_assert(test->m_notification); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Shown); >+ g_assert_nonnull(test->m_notification); > g_assert_cmpstr(webkit_notification_get_title(test->m_notification), ==, title); > g_assert_cmpstr(webkit_notification_get_body(test->m_notification), ==, body); > g_assert_cmpstr(webkit_notification_get_tag(test->m_notification), ==, tag); > > test->clickNotificationAndWaitUntilClicked(); >- g_assert(test->m_event == NotificationWebViewTest::OnClicked); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::OnClicked); > > test->closeNotificationAndWaitUntilClosed(); >- g_assert(test->m_event == NotificationWebViewTest::Closed); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Closed); > > test->requestNotificationAndWaitUntilShown(title, body); >- g_assert(test->m_event == NotificationWebViewTest::Shown); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Shown); > g_assert_cmpstr(webkit_notification_get_tag(test->m_notification), ==, nullptr); > > test->closeNotificationAndWaitUntilOnClosed(); >- g_assert(test->m_event == NotificationWebViewTest::OnClosed); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::OnClosed); > > // The first notification should be closed automatically because the tag is > // the same. It will crash in showNotificationCallback on failure. > test->requestNotificationAndWaitUntilShown(title, body, tag); > test->requestNotificationAndWaitUntilShown(title, body, tag); >- g_assert(test->m_event == NotificationWebViewTest::Shown); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Shown); > } > > static void setInitialNotificationPermissionsAllowedCallback(WebKitWebContext* context, NotificationWebViewTest* test) >@@ -1087,10 +1087,10 @@ static void testWebViewNotificationInitialPermissionAllowed(NotificationWebViewT > > test->loadURI(gServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(test->hasPermission()); >+ g_assert_true(test->hasPermission()); > > test->requestNotificationAndWaitUntilShown("This is a notification", "This is the body."); >- g_assert(test->m_event == NotificationWebViewTest::Shown); >+ g_assert_cmpint(test->m_event, ==, NotificationWebViewTest::Shown); > } > > static void testWebViewNotificationInitialPermissionDisallowed(NotificationWebViewTest* test, gconstpointer) >@@ -1100,7 +1100,7 @@ static void testWebViewNotificationInitialPermissionDisallowed(NotificationWebVi > > test->loadURI(gServer->getURIForPath("/").data()); > test->waitUntilLoadFinished(); >- g_assert(!test->hasPermission()); >+ g_assert_false(test->hasPermission()); > } > #endif // ENABLE(NOTIFICATIONS) > >@@ -1113,24 +1113,24 @@ static void testWebViewIsPlayingAudio(IsPlayingAudioWebViewTest* test, gconstpoi > #endif > > // Initially, web views should always report no audio being played. >- g_assert(!webkit_web_view_is_playing_audio(test->m_webView)); >+ g_assert_false(webkit_web_view_is_playing_audio(test->m_webView)); > > GUniquePtr<char> resourcePath(g_build_filename(Test::getResourcesDir(Test::WebKit2Resources).data(), "file-with-video.html", nullptr)); > GUniquePtr<char> resourceURL(g_filename_to_uri(resourcePath.get(), nullptr, nullptr)); > webkit_web_view_load_uri(test->m_webView, resourceURL.get()); > test->waitUntilLoadFinished(); >- g_assert(!webkit_web_view_is_playing_audio(test->m_webView)); >+ g_assert_false(webkit_web_view_is_playing_audio(test->m_webView)); > > test->runJavaScriptAndWaitUntilFinished("playVideo();", nullptr); > if (!webkit_web_view_is_playing_audio(test->m_webView)) > test->waitUntilIsPlayingAudioChanged(); >- g_assert(webkit_web_view_is_playing_audio(test->m_webView)); >+ g_assert_true(webkit_web_view_is_playing_audio(test->m_webView)); > > // Pause the video, and check again. > test->runJavaScriptAndWaitUntilFinished("document.getElementById('test-video').pause();", nullptr); > if (webkit_web_view_is_playing_audio(test->m_webView)) > test->waitUntilIsPlayingAudioChanged(); >- g_assert(!webkit_web_view_is_playing_audio(test->m_webView)); >+ g_assert_false(webkit_web_view_is_playing_audio(test->m_webView)); > } > > #if PLATFORM(GTK) >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp >index 0266cb0dc844ec1ae70f5d9d9a3c0f0fa950d25f..e54552e038d8532c106d2bf349cc6a69f4a305eb 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp >@@ -79,7 +79,7 @@ public: > WebsiteDataTest() > : m_manager(webkit_web_context_get_website_data_manager(webkit_web_view_get_context(m_webView))) > { >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(m_manager)); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(m_manager)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_manager)); > // WebsiteDataStore creates a new WebProcessPool when used before any secondary process has been created. > // Ensure we have a web process by always loading about:blank here. >@@ -111,7 +111,7 @@ public: > { > webkit_website_data_manager_remove(m_manager, types, dataList, nullptr, [](GObject*, GAsyncResult* result, gpointer userData) { > WebsiteDataTest* test = static_cast<WebsiteDataTest*>(userData); >- g_assert(webkit_website_data_manager_remove_finish(test->m_manager, result, nullptr)); >+ g_assert_true(webkit_website_data_manager_remove_finish(test->m_manager, result, nullptr)); > test->quitMainLoop(); > }, this); > g_main_loop_run(m_mainLoop); >@@ -121,7 +121,7 @@ public: > { > webkit_website_data_manager_clear(m_manager, types, timeSpan, nullptr, [](GObject*, GAsyncResult* result, gpointer userData) { > WebsiteDataTest* test = static_cast<WebsiteDataTest*>(userData); >- g_assert(webkit_website_data_manager_clear_finish(test->m_manager, result, nullptr)); >+ g_assert_true(webkit_website_data_manager_clear_finish(test->m_manager, result, nullptr)); > test->quitMainLoop(); > }, this); > g_main_loop_run(m_mainLoop); >@@ -134,24 +134,24 @@ public: > static void testWebsiteDataConfiguration(WebsiteDataTest* test, gconstpointer) > { > // Base directories are not used by TestMain. >- g_assert(!webkit_website_data_manager_get_base_data_directory(test->m_manager)); >- g_assert(!webkit_website_data_manager_get_base_cache_directory(test->m_manager)); >+ g_assert_null(webkit_website_data_manager_get_base_data_directory(test->m_manager)); >+ g_assert_null(webkit_website_data_manager_get_base_cache_directory(test->m_manager)); > > GUniquePtr<char> localStorageDirectory(g_build_filename(Test::dataDirectory(), "local-storage", nullptr)); > g_assert_cmpstr(localStorageDirectory.get(), ==, webkit_website_data_manager_get_local_storage_directory(test->m_manager)); >- g_assert(g_file_test(localStorageDirectory.get(), G_FILE_TEST_IS_DIR)); >+ g_assert_true(g_file_test(localStorageDirectory.get(), G_FILE_TEST_IS_DIR)); > > test->loadURI(kServer->getURIForPath("/empty").data()); > test->waitUntilLoadFinished(); > test->runJavaScriptAndWaitUntilFinished("window.indexedDB.open('TestDatabase');", nullptr); > GUniquePtr<char> indexedDBDirectory(g_build_filename(Test::dataDirectory(), "indexeddb", nullptr)); > g_assert_cmpstr(indexedDBDirectory.get(), ==, webkit_website_data_manager_get_indexeddb_directory(test->m_manager)); >- g_assert(g_file_test(indexedDBDirectory.get(), G_FILE_TEST_IS_DIR)); >+ g_assert_true(g_file_test(indexedDBDirectory.get(), G_FILE_TEST_IS_DIR)); > > GUniquePtr<char> webSQLDirectory(g_build_filename(Test::dataDirectory(), "websql", nullptr)); > g_assert_cmpstr(webSQLDirectory.get(), ==, webkit_website_data_manager_get_websql_directory(test->m_manager)); > test->runJavaScriptAndWaitUntilFinished("db = openDatabase(\"TestDatabase\", \"1.0\", \"TestDatabase\", 1);", nullptr); >- g_assert(g_file_test(webSQLDirectory.get(), G_FILE_TEST_IS_DIR)); >+ g_assert_true(g_file_test(webSQLDirectory.get(), G_FILE_TEST_IS_DIR)); > > test->loadURI(kServer->getURIForPath("/appcache").data()); > test->waitUntilLoadFinished(); >@@ -161,22 +161,22 @@ static void testWebsiteDataConfiguration(WebsiteDataTest* test, gconstpointer) > unsigned triesCount = 4; > while (!g_file_test(applicationCacheDatabase.get(), G_FILE_TEST_IS_REGULAR) && --triesCount) > test->wait(0.25); >- g_assert(triesCount); >+ g_assert_cmpuint(triesCount, >, 0); > > GUniquePtr<char> diskCacheDirectory(g_build_filename(Test::dataDirectory(), "disk-cache", nullptr)); > g_assert_cmpstr(diskCacheDirectory.get(), ==, webkit_website_data_manager_get_disk_cache_directory(test->m_manager)); >- g_assert(g_file_test(diskCacheDirectory.get(), G_FILE_TEST_IS_DIR)); >+ g_assert_true(g_file_test(diskCacheDirectory.get(), G_FILE_TEST_IS_DIR)); > > // Clear all persistent caches, since the data dir is common to all test cases. > static const WebKitWebsiteDataTypes persistentCaches = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_DISK_CACHE | WEBKIT_WEBSITE_DATA_LOCAL_STORAGE > | WEBKIT_WEBSITE_DATA_WEBSQL_DATABASES | WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES | WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE | WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); > test->clear(persistentCaches, 0); >- g_assert(!test->fetch(persistentCaches)); >+ g_assert_null(test->fetch(persistentCaches)); > > // The default context should have a different manager with different configuration. > WebKitWebsiteDataManager* defaultManager = webkit_web_context_get_website_data_manager(webkit_web_context_get_default()); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(defaultManager)); >- g_assert(test->m_manager != defaultManager); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(defaultManager)); >+ g_assert_cmphex(test->m_manager, !=, defaultManager); > g_assert_cmpstr(webkit_website_data_manager_get_local_storage_directory(test->m_manager), !=, webkit_website_data_manager_get_local_storage_directory(defaultManager)); > g_assert_cmpstr(webkit_website_data_manager_get_indexeddb_directory(test->m_manager), !=, webkit_website_data_manager_get_indexeddb_directory(defaultManager)); > g_assert_cmpstr(webkit_website_data_manager_get_disk_cache_directory(test->m_manager), !=, webkit_website_data_manager_get_disk_cache_directory(defaultManager)); >@@ -185,7 +185,7 @@ static void testWebsiteDataConfiguration(WebsiteDataTest* test, gconstpointer) > > // Using Test::dataDirectory() we get the default configuration but for a differrent prefix. > GRefPtr<WebKitWebsiteDataManager> baseDataManager = adoptGRef(webkit_website_data_manager_new("base-data-directory", Test::dataDirectory(), "base-cache-directory", Test::dataDirectory(), nullptr)); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(baseDataManager.get())); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(baseDataManager.get())); > > localStorageDirectory.reset(g_build_filename(Test::dataDirectory(), "localstorage", nullptr)); > g_assert_cmpstr(webkit_website_data_manager_get_local_storage_directory(baseDataManager.get()), ==, localStorageDirectory.get()); >@@ -225,26 +225,26 @@ static void ephemeralViewloadChanged(WebKitWebView* webView, WebKitLoadEvent loa > static void testWebsiteDataEphemeral(WebViewTest* test, gconstpointer) > { > GRefPtr<WebKitWebsiteDataManager> manager = adoptGRef(webkit_website_data_manager_new_ephemeral()); >- g_assert(webkit_website_data_manager_is_ephemeral(manager.get())); >- g_assert(!webkit_website_data_manager_get_base_data_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_base_cache_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_local_storage_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_disk_cache_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_offline_application_cache_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_indexeddb_directory(manager.get())); >- g_assert(!webkit_website_data_manager_get_websql_directory(manager.get())); >+ g_assert_true(webkit_website_data_manager_is_ephemeral(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_base_data_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_base_cache_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_local_storage_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_disk_cache_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_offline_application_cache_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_indexeddb_directory(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_websql_directory(manager.get())); > > // Configuration is ignored when is-ephemeral is used. > manager = adoptGRef(WEBKIT_WEBSITE_DATA_MANAGER(g_object_new(WEBKIT_TYPE_WEBSITE_DATA_MANAGER, "base-data-directory", Test::dataDirectory(), "is-ephemeral", TRUE, nullptr))); >- g_assert(webkit_website_data_manager_is_ephemeral(manager.get())); >- g_assert(!webkit_website_data_manager_get_base_data_directory(manager.get())); >+ g_assert_true(webkit_website_data_manager_is_ephemeral(manager.get())); >+ g_assert_null(webkit_website_data_manager_get_base_data_directory(manager.get())); > > // Non persistent data can be queried in an ephemeral manager. > GRefPtr<WebKitWebContext> webContext = adoptGRef(webkit_web_context_new_with_website_data_manager(manager.get())); >- g_assert(webkit_web_context_is_ephemeral(webContext.get())); >+ g_assert_true(webkit_web_context_is_ephemeral(webContext.get())); > auto webView = Test::adoptView(Test::createWebView(webContext.get())); >- g_assert(webkit_web_view_is_ephemeral(webView.get())); >- g_assert(webkit_web_view_get_website_data_manager(webView.get()) == manager.get()); >+ g_assert_true(webkit_web_view_is_ephemeral(webView.get())); >+ g_assert_cmphex(webkit_web_view_get_website_data_manager(webView.get()), ==, manager.get()); > > g_signal_connect(webView.get(), "load-changed", G_CALLBACK(ephemeralViewloadChanged), test); > webkit_web_view_load_uri(webView.get(), kServer->getURIForPath("/empty").data()); >@@ -253,10 +253,10 @@ static void testWebsiteDataEphemeral(WebViewTest* test, gconstpointer) > webkit_website_data_manager_fetch(manager.get(), WEBKIT_WEBSITE_DATA_MEMORY_CACHE, nullptr, [](GObject* manager, GAsyncResult* result, gpointer userData) { > auto* test = static_cast<WebViewTest*>(userData); > GList* dataList = webkit_website_data_manager_fetch_finish(WEBKIT_WEBSITE_DATA_MANAGER(manager), result, nullptr); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -270,7 +270,7 @@ static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer) > { > static const WebKitWebsiteDataTypes cacheTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE); > GList* dataList = test->fetch(cacheTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/empty").data()); > test->waitUntilLoadFinished(); >@@ -281,10 +281,10 @@ static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer) > test->wait(1); > > dataList = test->fetch(cacheTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -295,12 +295,12 @@ static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer) > > // Try again but only getting disk cache. > dataList = test->fetch(WEBKIT_WEBSITE_DATA_DISK_CACHE); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >- g_assert(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE); >- g_assert(!(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_MEMORY_CACHE)); >+ g_assert_nonnull(data); >+ g_assert_true(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE); >+ g_assert_false(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_MEMORY_CACHE); > > GUniquePtr<char> fileURL(g_strdup_printf("file://%s/simple.html", Test::getResourcesDir(Test::WebKit2Resources).data())); > test->loadURI(fileURL.get()); >@@ -312,24 +312,24 @@ static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer) > > // Local files are grouped. > dataList = test->fetch(cacheTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 2); > GList* itemList = g_list_find_custom(dataList, nullptr, [](gconstpointer item, gconstpointer) -> int { > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(const_cast<gpointer>(item)); > return g_strcmp0(webkit_website_data_get_name(data), "Local files"); > }); >- g_assert(itemList); >+ g_assert_nonnull(itemList); > data = static_cast<WebKitWebsiteData*>(itemList->data); >- g_assert(data); >- g_assert(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_MEMORY_CACHE); >+ g_assert_nonnull(data); >+ g_assert_true(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_MEMORY_CACHE); > // Local files are never stored in disk cache. >- g_assert(!(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE)); >+ g_assert_false(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE); > > // Clear data modified since the last microsecond should not clear anything. > // Use disk-cache because memory cache ignores the modified since. > test->clear(WEBKIT_WEBSITE_DATA_DISK_CACHE, 1); > dataList = test->fetch(cacheTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 2); > > // Remove memory cache only for local files. >@@ -337,26 +337,26 @@ static void testWebsiteDataCache(WebsiteDataTest* test, gconstpointer) > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(const_cast<gpointer>(item)); > return g_strcmp0(webkit_website_data_get_name(data), "Local files"); > }); >- g_assert(itemList); >+ g_assert_nonnull(itemList); > GList removeList = { itemList->data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_MEMORY_CACHE, &removeList); > dataList = test->fetch(cacheTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE); >+ g_assert_true(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_DISK_CACHE); > > // Clear all. > test->clear(cacheTypes, 0); > dataList = test->fetch(cacheTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > } > > static void testWebsiteDataStorage(WebsiteDataTest* test, gconstpointer) > { > static const WebKitWebsiteDataTypes storageTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_SESSION_STORAGE | WEBKIT_WEBSITE_DATA_LOCAL_STORAGE); > GList* dataList = test->fetch(storageTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/sessionstorage").data()); > test->waitUntilLoadFinished(); >@@ -368,10 +368,10 @@ static void testWebsiteDataStorage(WebsiteDataTest* test, gconstpointer) > test->wait(1); > > dataList = test->fetch(storageTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -383,52 +383,52 @@ static void testWebsiteDataStorage(WebsiteDataTest* test, gconstpointer) > // Get also cached data, and clear it. > static const WebKitWebsiteDataTypes cacheAndStorageTypes = static_cast<WebKitWebsiteDataTypes>(storageTypes | WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE); > dataList = test->fetch(cacheAndStorageTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > g_assert_cmpuint(webkit_website_data_get_types(data), ==, cacheAndStorageTypes); > test->clear(static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE), 0); > > // Get all types again, but only storage is retrieved now. > dataList = test->fetch(cacheAndStorageTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > g_assert_cmpuint(webkit_website_data_get_types(data), ==, storageTypes); > > // Remove the session storage. > GList removeList = { data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_SESSION_STORAGE, &removeList); > dataList = test->fetch(storageTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(!(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_SESSION_STORAGE)); >- g_assert(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_LOCAL_STORAGE); >+ g_assert_false(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_SESSION_STORAGE); >+ g_assert_true(webkit_website_data_get_types(data) & WEBKIT_WEBSITE_DATA_LOCAL_STORAGE); > > // Clear all. > test->clear(cacheAndStorageTypes, 0); > dataList = test->fetch(cacheAndStorageTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > } > > static void testWebsiteDataDatabases(WebsiteDataTest* test, gconstpointer) > { > static const WebKitWebsiteDataTypes databaseTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_WEBSQL_DATABASES | WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES); > GList* dataList = test->fetch(databaseTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/empty").data()); > test->waitUntilLoadFinished(); > test->runJavaScriptAndWaitUntilFinished("window.indexedDB.open('TestDatabase');", nullptr); > > dataList = test->fetch(databaseTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -438,10 +438,10 @@ static void testWebsiteDataDatabases(WebsiteDataTest* test, gconstpointer) > > test->runJavaScriptAndWaitUntilFinished("db = openDatabase(\"TestDatabase\", \"1.0\", \"TestDatabase\", 1);", nullptr); > dataList = test->fetch(databaseTypes); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > g_assert_cmpuint(webkit_website_data_get_types(data), ==, databaseTypes); > // Database sizes are unknown. > g_assert_cmpuint(webkit_website_data_get_size(data, WEBKIT_WEBSITE_DATA_INDEXEDDB_DATABASES), ==, 0); >@@ -451,29 +451,29 @@ static void testWebsiteDataDatabases(WebsiteDataTest* test, gconstpointer) > GList removeList = { data, nullptr, nullptr }; > test->remove(databaseTypes, &removeList); > dataList = test->fetch(databaseTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > > // Clear all. > static const WebKitWebsiteDataTypes cacheAndDatabaseTypes = static_cast<WebKitWebsiteDataTypes>(databaseTypes | WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE); > test->clear(cacheAndDatabaseTypes, 0); > dataList = test->fetch(cacheAndDatabaseTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > } > > static void testWebsiteDataAppcache(WebsiteDataTest* test, gconstpointer) > { > GList* dataList = test->fetch(WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/appcache").data()); > test->waitUntilLoadFinished(); > > test->wait(1); > dataList = test->fetch(WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -484,28 +484,28 @@ static void testWebsiteDataAppcache(WebsiteDataTest* test, gconstpointer) > GList removeList = { data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE, &removeList); > dataList = test->fetch(WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE); >- g_assert(!dataList); >+ g_assert_null(dataList); > > // Clear all. > static const WebKitWebsiteDataTypes cacheAndAppcacheTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE | WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE); > test->clear(cacheAndAppcacheTypes, 0); > dataList = test->fetch(cacheAndAppcacheTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > } > > static void testWebsiteDataCookies(WebsiteDataTest* test, gconstpointer) > { > GList* dataList = test->fetch(WEBKIT_WEBSITE_DATA_COOKIES); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/empty").data()); > test->waitUntilLoadFinished(); > > dataList = test->fetch(WEBKIT_WEBSITE_DATA_COOKIES); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, "127.0.0.1"); > g_assert_cmpuint(webkit_website_data_get_types(data), ==, WEBKIT_WEBSITE_DATA_COOKIES); > // Cookies size is unknown. >@@ -514,13 +514,13 @@ static void testWebsiteDataCookies(WebsiteDataTest* test, gconstpointer) > GList removeList = { data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_COOKIES, &removeList); > dataList = test->fetch(WEBKIT_WEBSITE_DATA_COOKIES); >- g_assert(!dataList); >+ g_assert_null(dataList); > > // Clear all. > static const WebKitWebsiteDataTypes cacheAndCookieTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_COOKIES | WEBKIT_WEBSITE_DATA_MEMORY_CACHE | WEBKIT_WEBSITE_DATA_DISK_CACHE); > test->clear(cacheAndCookieTypes, 0); > dataList = test->fetch(cacheAndCookieTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > } > > static void testWebsiteDataDeviceIdHashSalt(WebsiteDataTest* test, gconstpointer) >@@ -532,17 +532,17 @@ static void testWebsiteDataDeviceIdHashSalt(WebsiteDataTest* test, gconstpointer > test->clear(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT, 0); > > GList* dataList = test->fetch(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); >- g_assert(!dataList); >+ g_assert_null(dataList); > > test->loadURI(kServer->getURIForPath("/enumeratedevices").data()); > test->waitUntilTitleChangedTo("Finished"); > > dataList = test->fetch(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > > g_assert_cmpuint(g_list_length(dataList), ==, 1); > WebKitWebsiteData* data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > WebKitSecurityOrigin* origin = webkit_security_origin_new_for_uri(kServer->getURIForPath("/").data()); > g_assert_cmpstr(webkit_website_data_get_name(data), ==, webkit_security_origin_get_host(origin)); > webkit_security_origin_unref(origin); >@@ -551,27 +551,27 @@ static void testWebsiteDataDeviceIdHashSalt(WebsiteDataTest* test, gconstpointer > GList removeList = { data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT, &removeList); > dataList = test->fetch(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); >- g_assert(!dataList); >+ g_assert_null(dataList); > > // Test removing the cookies. > test->loadURI(kServer->getURIForPath("/enumeratedevices").data()); > test->waitUntilTitleChangedTo("Finished"); > > dataList = test->fetch(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); >- g_assert(dataList); >+ g_assert_nonnull(dataList); > data = static_cast<WebKitWebsiteData*>(dataList->data); >- g_assert(data); >+ g_assert_nonnull(data); > > GList removeCookieList = { data, nullptr, nullptr }; > test->remove(WEBKIT_WEBSITE_DATA_COOKIES, &removeCookieList); > dataList = test->fetch(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); >- g_assert(!dataList); >+ g_assert_null(dataList); > > // Clear all. > static const WebKitWebsiteDataTypes cacheAndAppcacheTypes = static_cast<WebKitWebsiteDataTypes>(WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT); > test->clear(cacheAndAppcacheTypes, 0); > dataList = test->fetch(cacheAndAppcacheTypes); >- g_assert(!dataList); >+ g_assert_null(dataList); > > webkit_settings_set_enable_media_stream(settings, enabled); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp >index 97a75e5141e88274a33a93a627120557ded4f886..0e29f41ce9bfcbefecade69059cebab2cfb915ae 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebExtensionTest.cpp >@@ -18,7 +18,7 @@ > */ > > #include "config.h" >- >+#include "WebProcessTest.h" > #include <JavaScriptCore/JSContextRef.h> > #include <JavaScriptCore/JSRetainPtr.h> > #include <gio/gio.h> >@@ -138,7 +138,7 @@ static void emitDocumentLoaded(GDBusConnection* connection) > "DocumentLoaded", > 0, > 0); >- g_assert(ok); >+ g_assert_true(ok); > } > > static void documentLoadedCallback(WebKitWebPage* webPage, WebKitWebExtension* extension) >@@ -168,7 +168,7 @@ static void emitURIChanged(GDBusConnection* connection, const char* uri) > "URIChanged", > g_variant_new("(s)", uri), > 0); >- g_assert(ok); >+ g_assert_true(ok); > } > > static void uriChangedCallback(WebKitWebPage* webPage, GParamSpec* pspec, WebKitWebExtension* extension) >@@ -184,7 +184,7 @@ static gboolean sendRequestCallback(WebKitWebPage*, WebKitURIRequest* request, W > { > gboolean returnValue = FALSE; > const char* requestURI = webkit_uri_request_get_uri(request); >- g_assert(requestURI); >+ g_assert_nonnull(requestURI); > > if (const char* suffix = g_strrstr(requestURI, "/remove-this/javascript.js")) { > GUniquePtr<char> prefix(g_strndup(requestURI, strlen(requestURI) - strlen(suffix))); >@@ -192,18 +192,18 @@ static gboolean sendRequestCallback(WebKitWebPage*, WebKitURIRequest* request, W > webkit_uri_request_set_uri(request, newURI.get()); > } else if (const char* suffix = g_strrstr(requestURI, "/remove-this/javascript-after-redirection.js")) { > // Redirected from /redirected.js, redirectResponse should be nullptr. >- g_assert(WEBKIT_IS_URI_RESPONSE(redirectResponse)); >- g_assert(g_str_has_suffix(webkit_uri_response_get_uri(redirectResponse), "/redirected.js")); >+ g_assert_true(WEBKIT_IS_URI_RESPONSE(redirectResponse)); >+ g_assert_true(g_str_has_suffix(webkit_uri_response_get_uri(redirectResponse), "/redirected.js")); > > GUniquePtr<char> prefix(g_strndup(requestURI, strlen(requestURI) - strlen(suffix))); > GUniquePtr<char> newURI(g_strdup_printf("%s/javascript-after-redirection.js", prefix.get())); > webkit_uri_request_set_uri(request, newURI.get()); > } else if (g_str_has_suffix(requestURI, "/redirected.js")) { > // Original request, redirectResponse should be nullptr. >- g_assert(!redirectResponse); >+ g_assert_null(redirectResponse); > } else if (g_str_has_suffix(requestURI, "/add-do-not-track-header")) { > SoupMessageHeaders* headers = webkit_uri_request_get_http_headers(request); >- g_assert(headers); >+ g_assert_nonnull(headers); > soup_message_headers_append(headers, "DNT", "1"); > } else if (g_str_has_suffix(requestURI, "/normal-change-request")) { > GUniquePtr<char> prefix(g_strndup(requestURI, strlen(requestURI) - strlen("/normal-change-request"))); >@@ -211,10 +211,10 @@ static gboolean sendRequestCallback(WebKitWebPage*, WebKitURIRequest* request, W > webkit_uri_request_set_uri(request, newURI.get()); > } else if (g_str_has_suffix(requestURI, "/http-get-method")) { > g_assert_cmpstr(webkit_uri_request_get_http_method(request), ==, "GET"); >- g_assert(webkit_uri_request_get_http_method(request) == SOUP_METHOD_GET); >+ g_assert_cmpstr(webkit_uri_request_get_http_method(request), ==, SOUP_METHOD_GET); > } else if (g_str_has_suffix(requestURI, "/http-post-method")) { > g_assert_cmpstr(webkit_uri_request_get_http_method(request), ==, "POST"); >- g_assert(webkit_uri_request_get_http_method(request) == SOUP_METHOD_POST); >+ g_assert_cmpstr(webkit_uri_request_get_http_method(request), ==, SOUP_METHOD_POST); > returnValue = TRUE; > } else if (g_str_has_suffix(requestURI, "/cancel-this.js")) > returnValue = TRUE; >@@ -277,7 +277,7 @@ static gboolean contextMenuCallback(WebKitWebPage* page, WebKitContextMenu* menu > > if (!g_strcmp0(pageURI, "ContextMenuTestNode")) { > WebKitDOMNode* node = webkit_web_hit_test_result_get_node(hitTestResult); >- g_assert(WEBKIT_DOM_IS_NODE(node)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(node)); > auto* frame = webkit_web_page_get_main_frame(page); > GRefPtr<JSCValue> jsNode = adoptGRef(webkit_frame_get_js_value_for_dom_object(frame, WEBKIT_DOM_OBJECT(node))); > webkit_context_menu_set_user_data(menu, serializeNode(jsNode.get())); >@@ -289,17 +289,17 @@ static gboolean contextMenuCallback(WebKitWebPage* page, WebKitContextMenu* menu > > static void consoleMessageSentCallback(WebKitWebPage* webPage, WebKitConsoleMessage* consoleMessage) > { >- g_assert(consoleMessage); >+ g_assert_nonnull(consoleMessage); > GRefPtr<GVariant> variant = g_variant_new("(uusus)", webkit_console_message_get_source(consoleMessage), > webkit_console_message_get_level(consoleMessage), webkit_console_message_get_text(consoleMessage), > webkit_console_message_get_line(consoleMessage), webkit_console_message_get_source_id(consoleMessage)); > GUniquePtr<char> messageString(g_variant_print(variant.get(), FALSE)); > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context(webkit_web_page_get_main_frame(webPage))); > GRefPtr<JSCValue> console = adoptGRef(jsc_context_evaluate(jsContext.get(), "window.webkit.messageHandlers.console", -1)); >- g_assert(JSC_IS_VALUE(console.get())); >+ g_assert_true(JSC_IS_VALUE(console.get())); > if (jsc_value_is_object(console.get())) { > GRefPtr<JSCValue> result = adoptGRef(jsc_value_object_invoke_method(console.get(), "postMessage", G_TYPE_STRING, messageString.get(), G_TYPE_NONE)); >- g_assert(JSC_IS_VALUE(result.get())); >+ g_assert_true(JSC_IS_VALUE(result.get())); > } > } > >@@ -313,7 +313,7 @@ static void emitFormControlsAssociated(GDBusConnection* connection, const char* > "FormControlsAssociated", > g_variant_new("(s)", formIds), > nullptr); >- g_assert(ok); >+ g_assert_true(ok); > } > > static void formControlsAssociatedCallback(WebKitWebPage* webPage, GPtrArray* formElements, WebKitWebExtension* extension) >@@ -321,11 +321,11 @@ static void formControlsAssociatedCallback(WebKitWebPage* webPage, GPtrArray* fo > auto* frame = webkit_web_page_get_main_frame(webPage); > GString* formIdsBuilder = g_string_new(nullptr); > for (guint i = 0; i < formElements->len; ++i) { >- g_assert(WEBKIT_DOM_IS_ELEMENT(g_ptr_array_index(formElements, i))); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(g_ptr_array_index(formElements, i))); > GRefPtr<JSCValue> value = adoptGRef(webkit_frame_get_js_value_for_dom_object(frame, WEBKIT_DOM_OBJECT(g_ptr_array_index(formElements, i)))); >- g_assert(JSC_IS_VALUE(value.get())); >- g_assert(jsc_value_is_object(value.get())); >- g_assert(jsc_value_object_is_instance_of(value.get(), "Element")); >+ g_assert_true(JSC_IS_VALUE(value.get())); >+ g_assert_true(jsc_value_is_object(value.get())); >+ g_assert_true(jsc_value_object_is_instance_of(value.get(), "Element")); > GRefPtr<JSCValue> idValue = adoptGRef(jsc_value_object_get_property(value.get(), "id")); > GUniquePtr<char> elementID(jsc_value_to_string(idValue.get())); > g_string_append(formIdsBuilder, elementID.get()); >@@ -352,7 +352,7 @@ static void emitFormSubmissionEvent(GDBusConnection* connection, const char* met > methodName, > g_variant_new("(sssbb)", formID ? formID : "", names, values, targetFrameIsMainFrame, sourceFrameIsMainFrame), > nullptr); >- g_assert(ok); >+ g_assert_true(ok); > } > > static void handleFormSubmissionCallback(WebKitWebPage* webPage, DelayedSignalType delayedSignalType, const char* methodName, const char* formID, WebKitFrame* sourceFrame, WebKitFrame* targetFrame, GPtrArray* textFieldNames, GPtrArray* textFieldValues, WebKitWebExtension* extension) >@@ -384,13 +384,13 @@ static void willSubmitFormCallback(WebKitWebPage* webPage, WebKitDOMElement* for > { > #if PLATFORM(GTK) > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; >- g_assert(WEBKIT_DOM_IS_HTML_FORM_ELEMENT(formElement)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_FORM_ELEMENT(formElement)); > G_GNUC_END_IGNORE_DEPRECATIONS; > #endif > GRefPtr<JSCValue> jsFormElement = adoptGRef(webkit_frame_get_js_value_for_dom_object(webkit_web_page_get_main_frame(webPage), WEBKIT_DOM_OBJECT(formElement))); >- g_assert(JSC_IS_VALUE(jsFormElement.get())); >- g_assert(jsc_value_is_object(jsFormElement.get())); >- g_assert(jsc_value_object_is_instance_of(jsFormElement.get(), "HTMLFormElement")); >+ g_assert_true(JSC_IS_VALUE(jsFormElement.get())); >+ g_assert_true(jsc_value_is_object(jsFormElement.get())); >+ g_assert_true(jsc_value_object_is_instance_of(jsFormElement.get(), "HTMLFormElement")); > GRefPtr<JSCValue> idValue = adoptGRef(jsc_value_object_get_property(jsFormElement.get(), "id")); > GUniquePtr<char> formID(jsc_value_to_string(idValue.get())); > >@@ -425,7 +425,7 @@ static char* echoCallback(const char* message) > static void windowObjectCleared(WebKitScriptWorld* world, WebKitWebPage* page, WebKitFrame* frame, gpointer) > { > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context_for_script_world(frame, world)); >- g_assert(JSC_IS_CONTEXT(jsContext.get())); >+ g_assert_true(JSC_IS_CONTEXT(jsContext.get())); > GRefPtr<JSCValue> function = adoptGRef(jsc_value_new_function(jsContext.get(), "echo", G_CALLBACK(echoCallback), NULL, NULL, G_TYPE_STRING, 1, G_TYPE_STRING)); > jsc_context_set_value(jsContext.get(), "echo", function.get()); > } >@@ -485,8 +485,8 @@ static void methodCallCallback(GDBusConnection* connection, const char* sender, > return; > > GRefPtr<WebKitScriptWorld> world = adoptGRef(webkit_script_world_new()); >- g_assert(webkit_script_world_get_default() != world.get()); >- g_assert(g_str_has_prefix(webkit_script_world_get_name(world.get()), "UniqueWorld_")); >+ g_assert_cmphex(webkit_script_world_get_default(), !=, world.get()); >+ g_assert_true(g_str_has_prefix(webkit_script_world_get_name(world.get()), "UniqueWorld_")); > WebKitFrame* frame = webkit_web_page_get_main_frame(page); > GRefPtr<JSCContext> jsContext = adoptGRef(webkit_frame_get_js_context_for_script_world(frame, world.get())); > GRefPtr<JSCValue> result = adoptGRef(jsc_context_evaluate(jsContext.get(), script, -1)); >@@ -561,7 +561,7 @@ static void registerGResource(void) > { > GUniquePtr<char> resourcesPath(g_build_filename(WEBKIT_TEST_RESOURCES_DIR, "webkitglib-tests-resources.gresource", nullptr)); > GResource* resource = g_resource_load(resourcesPath.get(), nullptr); >- g_assert(resource); >+ g_assert_nonnull(resource); > > g_resources_register(resource); > g_resource_unref(resource); >@@ -570,7 +570,7 @@ static void registerGResource(void) > extern "C" void webkit_web_extension_initialize_with_user_data(WebKitWebExtension* extension, GVariant* userData) > { > WebKitScriptWorld* isolatedWorld = webkit_script_world_new_with_name("WebExtensionTestScriptWorld"); >- g_assert(WEBKIT_IS_SCRIPT_WORLD(isolatedWorld)); >+ g_assert_true(WEBKIT_IS_SCRIPT_WORLD(isolatedWorld)); > g_assert_cmpstr(webkit_script_world_get_name(isolatedWorld), ==, "WebExtensionTestScriptWorld"); > g_object_set_data_full(G_OBJECT(extension), "wk-script-world", isolatedWorld, g_object_unref); > >@@ -579,8 +579,8 @@ extern "C" void webkit_web_extension_initialize_with_user_data(WebKitWebExtensio > > registerGResource(); > >- g_assert(userData); >- g_assert(g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32)); >+ g_assert_nonnull(userData); >+ g_assert_true(g_variant_is_of_type(userData, G_VARIANT_TYPE_UINT32)); > GUniquePtr<char> busName(g_strdup_printf("org.webkit.gtk.WebExtensionTest%u", g_variant_get_uint32(userData))); > g_bus_own_name( > G_BUS_TYPE_SESSION, >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >index da06f42de4fb9ff38ff93a2d4e97665a4ed2be2c..f441a719a823682e3a17858c750a14dbd7dd8d8a 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.cpp >@@ -46,7 +46,7 @@ static void checkLeaks() > g_print(" %s(%p)", g_type_name_from_instance(reinterpret_cast<GTypeInstance*>(object)), object); > g_print("\n"); > >- g_assert(s_watchedObjects.isEmpty()); >+ g_assert_true(s_watchedObjects.isEmpty()); > } > > void WebProcessTest::add(const String& testName, std::function<std::unique_ptr<WebProcessTest> ()> closure) >@@ -64,15 +64,15 @@ void WebProcessTest::assertObjectIsDeletedWhenTestFinishes(GObject* object) > > std::unique_ptr<WebProcessTest> WebProcessTest::create(const String& testName) > { >- g_assert(testsMap().contains(testName)); >+ g_assert_true(testsMap().contains(testName)); > return testsMap().get(testName)(); > } > > static gboolean runTest(WebKitWebPage* webPage, const char* testPath) > { >- g_assert(WEBKIT_IS_WEB_PAGE(webPage)); >+ g_assert_true(WEBKIT_IS_WEB_PAGE(webPage)); > WebProcessTest::assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webPage)); >- g_assert(testPath); >+ g_assert_nonnull(testPath); > > std::unique_ptr<WebProcessTest> test = WebProcessTest::create(String::fromUTF8(testPath)); > return test->runTest(g_strrstr(testPath, "/") + 1, webPage); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >index 7a44cb05cd4bc027e12d1103faf6a007ac6f40f3..e0f63b9387dd64c57557546952a306aa95ac3a2d 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >+++ b/Tools/TestWebKitAPI/Tests/WebKitGLib/WebProcessTest.h >@@ -17,6 +17,8 @@ > * Boston, MA 02110-1301, USA. > */ > >+#include "TestUtils.h" >+ > #include <functional> > #include <wtf/HashMap.h> > #include <wtf/glib/GRefPtr.h> >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >index 0ede72fac46d35a820d4b15a2c23a4d4899099bf..f79cf3451829f4f526ccbd3a65adca976cb29438 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/AutocleanupsTest.cpp >@@ -33,25 +33,25 @@ private: > { > // Transfer none > g_autoptr(WebKitWebPage) page = WEBKIT_WEB_PAGE(g_object_ref(G_OBJECT(webPage))); >- g_assert(WEBKIT_IS_WEB_PAGE(page)); >+ g_assert_true(WEBKIT_IS_WEB_PAGE(page)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(page)); > > // Transfer none > g_autoptr(WebKitDOMDocument) document = WEBKIT_DOM_DOCUMENT(g_object_ref(G_OBJECT(webkit_web_page_get_dom_document(page)))); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > // Transfer full > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > g_autoptr(WebKitDOMDOMWindow) window = webkit_dom_document_get_default_view(document); >- g_assert(WEBKIT_DOM_IS_DOM_WINDOW(window)); >+ g_assert_true(WEBKIT_DOM_IS_DOM_WINDOW(window)); > G_GNUC_END_IGNORE_DEPRECATIONS; > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(window)); > > // Transfer full > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > g_autoptr(WebKitDOMRange) range = webkit_dom_document_create_range(document); >- g_assert(WEBKIT_DOM_IS_RANGE(range)); >+ g_assert_true(WEBKIT_DOM_IS_RANGE(range)); > G_GNUC_END_IGNORE_DEPRECATIONS; > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(range)); > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >index 20cdfe5ef91c41c21504f11c85c84168f11e1115..2e0d1860d5b88bbb44c373e431431f3126f62ade 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMClientRectTest.cpp >@@ -45,15 +45,15 @@ private: > bool testDivBoundingClientRectPosition(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMElement* div = webkit_dom_document_get_element_by_id(document, "rect"); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(div)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(div)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(div)); > > GRefPtr<WebKitDOMClientRect> clientRect = adoptGRef(webkit_dom_element_get_bounding_client_rect(div)); >- g_assert(WEBKIT_DOM_IS_CLIENT_RECT(clientRect.get())); >+ g_assert_true(WEBKIT_DOM_IS_CLIENT_RECT(clientRect.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(clientRect.get())); > checkClientRectPosition(clientRect.get()); > >@@ -63,27 +63,27 @@ private: > bool testDivClientRectsPositionAndLength(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMElement* div = webkit_dom_document_get_element_by_id(document, "rect"); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(div)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(div)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(div)); > > GRefPtr<WebKitDOMClientRectList> clientRectList = adoptGRef(webkit_dom_element_get_client_rects(div)); >- g_assert(WEBKIT_DOM_IS_CLIENT_RECT_LIST(clientRectList.get())); >+ g_assert_true(WEBKIT_DOM_IS_CLIENT_RECT_LIST(clientRectList.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(clientRectList.get())); > > g_assert_cmpuint(webkit_dom_client_rect_list_get_length(clientRectList.get()), ==, 1); > > GRefPtr<WebKitDOMClientRect> clientRect = adoptGRef(webkit_dom_client_rect_list_item(clientRectList.get(), 0)); >- g_assert(WEBKIT_DOM_IS_CLIENT_RECT(clientRect.get())); >+ g_assert_true(WEBKIT_DOM_IS_CLIENT_RECT(clientRect.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(clientRect.get())); > checkClientRectPosition(clientRect.get()); > > // Getting the clientRect twice should return the same pointer. > GRefPtr<WebKitDOMClientRect> clientRect2 = adoptGRef(webkit_dom_client_rect_list_item(clientRectList.get(), 0)); >- g_assert(clientRect.get() == clientRect2.get()); >+ g_assert_cmphex(clientRect.get(), ==, clientRect2.get()); > > return true; > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMDOMWindowTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMDOMWindowTest.cpp >index fc8cefb529d137e656deec2795a71ccc4b428775..125624196a71c6d3ad5bcdd29f142b86abb9fd11 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMDOMWindowTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMDOMWindowTest.cpp >@@ -54,12 +54,12 @@ private: > notify("ready", ""); > > WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args)); >- g_assert(WEBKIT_IS_WEB_PAGE(page)); >+ g_assert_true(WEBKIT_IS_WEB_PAGE(page)); > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > > WebKitDOMDOMWindow* domWindow = webkit_dom_document_get_default_view(document); >- g_assert(domWindow); >+ g_assert_nonnull(domWindow); > > // The "load" WebKitDOMDOMWindow signal is issued before this test is > // called. There's no way to capture it here. We simply assume that >@@ -77,10 +77,10 @@ private: > RunLoop::run(); > > document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > > WebKitDOMElement* element = webkit_dom_document_get_element_by_id(document, "test"); >- g_assert(element); >+ g_assert_nonnull(element); > > webkit_dom_event_target_add_event_listener( > WEBKIT_DOM_EVENT_TARGET(element), >@@ -102,12 +102,12 @@ private: > notify("ready", ""); > > WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args)); >- g_assert(WEBKIT_IS_WEB_PAGE(page)); >+ g_assert_true(WEBKIT_IS_WEB_PAGE(page)); > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > > WebKitDOMDOMWindow* domWindow = webkit_dom_document_get_default_view(document); >- g_assert(domWindow); >+ g_assert_nonnull(domWindow); > > // The "load" WebKitDOMDOMWindow signal is issued before this test is > // called. There's no way to capture it here. We simply assume that >@@ -125,15 +125,15 @@ private: > RunLoop::run(); > > document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > > WebKitDOMElement* element = webkit_dom_document_get_element_by_id(document, "test"); >- g_assert(element); >+ g_assert_nonnull(element); > > WebKitDOMEvent* event = webkit_dom_document_create_event(document, "MouseEvent", 0); >- g_assert(event); >- g_assert(WEBKIT_DOM_IS_EVENT(event)); >- g_assert(WEBKIT_DOM_IS_MOUSE_EVENT(event)); >+ g_assert_nonnull(event); >+ g_assert_true(WEBKIT_DOM_IS_EVENT(event)); >+ g_assert_true(WEBKIT_DOM_IS_MOUSE_EVENT(event)); > > glong clientX, clientY; > clientX = webkit_dom_element_get_client_left(element); >@@ -163,14 +163,14 @@ private: > bool testGetComputedStyle(WebKitWebExtension* extension, GVariant* args) > { > WebKitWebPage* page = webkit_web_extension_get_page(extension, webPageFromArgs(args)); >- g_assert(WEBKIT_IS_WEB_PAGE(page)); >+ g_assert_true(WEBKIT_IS_WEB_PAGE(page)); > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > WebKitDOMDOMWindow* domWindow = webkit_dom_document_get_default_view(document); >- g_assert(domWindow); >+ g_assert_nonnull(domWindow); > WebKitDOMElement* element = webkit_dom_document_get_element_by_id(document, "test"); >- g_assert(element); >- g_assert(WEBKIT_DOM_IS_ELEMENT(element)); >+ g_assert_nonnull(element); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(element)); > WebKitDOMCSSStyleDeclaration* cssStyle = webkit_dom_dom_window_get_computed_style(domWindow, element, 0); > gchar* fontSize = webkit_dom_css_style_declaration_get_property_value(cssStyle, "font-size"); > g_assert_cmpstr(fontSize, ==, "16px"); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >index 8970836f50b69c29ead1be90ad635b52d42ed06b..5df31052c201416f37a6825a0a36734c983881a9 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeFilterTest.cpp >@@ -67,18 +67,18 @@ private: > bool testTreeWalker(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMElement* root = webkit_dom_document_get_element_by_id(document, "root"); >- g_assert(WEBKIT_DOM_IS_NODE(root)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(root)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(root)); > > // No filter. > GRefPtr<WebKitDOMTreeWalker> walker = adoptGRef(webkit_dom_document_create_tree_walker(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ALL, nullptr, FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); >+ g_assert_true(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(walker.get())); >- g_assert(!webkit_dom_tree_walker_get_filter(walker.get())); >+ g_assert_null(webkit_dom_tree_walker_get_filter(walker.get())); > > unsigned i = 0; > for (WebKitDOMNode* node = WEBKIT_DOM_NODE(root); node; node = webkit_dom_tree_walker_next_node(walker.get()), ++i) { >@@ -92,9 +92,9 @@ private: > // Input elements filter. > GRefPtr<WebKitDOMNodeFilter> filter = adoptGRef(static_cast<WebKitDOMNodeFilter*>(g_object_new(webkit_node_filter_get_type(), nullptr))); > walker = adoptGRef(webkit_dom_document_create_tree_walker(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ALL, filter.get(), FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); >+ g_assert_true(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(filter.get())); >- g_assert(webkit_dom_tree_walker_get_filter(walker.get()) == filter.get()); >+ g_assert_cmphex(webkit_dom_tree_walker_get_filter(walker.get()), ==, filter.get()); > > i = 0; > for (WebKitDOMNode* node = WEBKIT_DOM_NODE(root); node; node = webkit_dom_tree_walker_next_node(walker.get()), ++i) { >@@ -107,9 +107,9 @@ private: > > // Show only elements, reusing the input filter. > walker = adoptGRef(webkit_dom_document_create_tree_walker(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ELEMENT, filter.get(), FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); >+ g_assert_true(WEBKIT_DOM_IS_TREE_WALKER(walker.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(walker.get())); >- g_assert(webkit_dom_tree_walker_get_filter(walker.get()) == filter.get()); >+ g_assert_cmphex(webkit_dom_tree_walker_get_filter(walker.get()), ==, filter.get()); > > i = 0; > for (WebKitDOMNode* node = WEBKIT_DOM_NODE(root); node; node = webkit_dom_tree_walker_next_node(walker.get()), ++i) { >@@ -126,18 +126,18 @@ private: > bool testNodeIterator(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMElement* root = webkit_dom_document_get_element_by_id(document, "root"); >- g_assert(WEBKIT_DOM_IS_NODE(root)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(root)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(root)); > > // No filter. > GRefPtr<WebKitDOMNodeIterator> iter = adoptGRef(webkit_dom_document_create_node_iterator(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ALL, nullptr, FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(iter.get())); >- g_assert(!webkit_dom_node_iterator_get_filter(iter.get())); >+ g_assert_null(webkit_dom_node_iterator_get_filter(iter.get())); > > unsigned i = 0; > while (WebKitDOMNode* node = webkit_dom_node_iterator_next_node(iter.get(), nullptr)) { >@@ -152,9 +152,9 @@ private: > // Input elements filter. > GRefPtr<WebKitDOMNodeFilter> filter = adoptGRef(static_cast<WebKitDOMNodeFilter*>(g_object_new(webkit_node_filter_get_type(), nullptr))); > iter = adoptGRef(webkit_dom_document_create_node_iterator(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ALL, filter.get(), FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(iter.get())); >- g_assert(webkit_dom_node_iterator_get_filter(iter.get()) == filter.get()); >+ g_assert_cmphex(webkit_dom_node_iterator_get_filter(iter.get()), ==, filter.get()); > > i = 0; > while (WebKitDOMNode* node = webkit_dom_node_iterator_next_node(iter.get(), nullptr)) { >@@ -168,9 +168,9 @@ private: > > // Show only elements, reusing the input filter. > iter = adoptGRef(webkit_dom_document_create_node_iterator(document, WEBKIT_DOM_NODE(root), WEBKIT_DOM_NODE_FILTER_SHOW_ELEMENT, filter.get(), FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(iter.get())); >- g_assert(webkit_dom_node_iterator_get_filter(iter.get()) == filter.get()); >+ g_assert_cmphex(webkit_dom_node_iterator_get_filter(iter.get()), ==, filter.get()); > > i = 0; > while (WebKitDOMNode* node = webkit_dom_node_iterator_next_node(iter.get(), nullptr)) { >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >index 79d76ae7d239f9a623ea679a65c589440bc0d623..ba7fab99cf6a6f5206fb0a36993223d56b5ffc43 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMNodeTest.cpp >@@ -34,41 +34,41 @@ private: > bool testHierarchyNavigation(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMHTMLHeadElement* head = webkit_dom_document_get_head(document); >- g_assert(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(head)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(head)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(head)); > > // Title, head's child. >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(head))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(head))); > GRefPtr<WebKitDOMNodeList> list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(head))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 1); > WebKitDOMNode* node = webkit_dom_node_list_item(list.get(), 0); >- g_assert(WEBKIT_DOM_IS_HTML_TITLE_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_TITLE_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > > // Body, Head sibling. > node = webkit_dom_node_get_next_sibling(WEBKIT_DOM_NODE(head)); >- g_assert(WEBKIT_DOM_IS_HTML_BODY_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_BODY_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > WebKitDOMHTMLBodyElement* body = WEBKIT_DOM_HTML_BODY_ELEMENT(node); > > // There is no third sibling >- g_assert(!webkit_dom_node_get_next_sibling(node)); >+ g_assert_null(webkit_dom_node_get_next_sibling(node)); > > // Body's previous sibling is Head. > node = webkit_dom_node_get_previous_sibling(WEBKIT_DOM_NODE(body)); >- g_assert(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_HEAD_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > > // Body has 3 children. >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > unsigned long length = webkit_dom_node_list_get_length(list.get()); > g_assert_cmpint(length, ==, 3); >@@ -76,7 +76,7 @@ private: > // The three of them are P tags. > for (unsigned long i = 0; i < length; i++) { > node = webkit_dom_node_list_item(list.get(), i); >- g_assert(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > } > >@@ -91,91 +91,91 @@ private: > bool testInsertion(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > WebKitDOMHTMLElement* body = webkit_dom_document_get_body(document); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(body)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(body)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(body)); > > // Body shouldn't have any children at this point. >- g_assert(!webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_false(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > > // The value of a non-existent attribute should be null, not an empty string >- g_assert(!webkit_dom_html_body_element_get_background(WEBKIT_DOM_HTML_BODY_ELEMENT(body))); >+ g_assert_null(webkit_dom_html_body_element_get_background(WEBKIT_DOM_HTML_BODY_ELEMENT(body))); > > // Insert one P element. > WebKitDOMElement* p = webkit_dom_document_create_element(document, "P", 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(p)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(p)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p)); > webkit_dom_node_append_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(p), 0); > > // Now it should have one, the same that we inserted. >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > GRefPtr<WebKitDOMNodeList> list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 1); > WebKitDOMNode* node = webkit_dom_node_list_item(list.get(), 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); >- g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); >+ g_assert_true(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); > > // Replace the P tag with a DIV tag. > WebKitDOMElement* div = webkit_dom_document_create_element(document, "DIV", 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(div)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(div)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(div)); > webkit_dom_node_replace_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE(p), 0); >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 1); > node = webkit_dom_node_list_item(list.get(), 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); >- g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); >+ g_assert_true(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); > > // Now remove the tag. > webkit_dom_node_remove_child(WEBKIT_DOM_NODE(body), node, 0); > list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 0); > > // Test insert before. If refChild is null, insert newChild as last element of parent. > div = webkit_dom_document_create_element(document, "DIV", 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(div)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(div)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(div)); > webkit_dom_node_insert_before(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(div), 0, 0); >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 1); > node = webkit_dom_node_list_item(list.get(), 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); >- g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); >+ g_assert_true(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); > > // Now insert a 'p' before 'div'. > p = webkit_dom_document_create_element(document, "P", 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(p)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(p)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p)); > webkit_dom_node_insert_before(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(p), WEBKIT_DOM_NODE(div), 0); >- g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); >+ g_assert_true(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); > list = adoptGRef(webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body))); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > g_assert_cmpint(webkit_dom_node_list_get_length(list.get()), ==, 2); > node = webkit_dom_node_list_item(list.get(), 0); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); >- g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); >+ g_assert_true(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); > node = webkit_dom_node_list_item(list.get(), 1); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(node)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); >- g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); >+ g_assert_true(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); > > return true; > } >@@ -185,17 +185,17 @@ private: > static const char* expectedTagNames[] = { "HTML", "HEAD", "BODY", "VIDEO", "SOURCE", "VIDEO", "SOURCE", "INPUT" }; > > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > GRefPtr<WebKitDOMNodeList> list = adoptGRef(webkit_dom_document_query_selector_all(document, "*", nullptr)); >- g_assert(WEBKIT_DOM_IS_NODE_LIST(list.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_LIST(list.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(list.get())); > gulong nodeCount = webkit_dom_node_list_get_length(list.get()); > g_assert_cmpuint(nodeCount, ==, G_N_ELEMENTS(expectedTagNames)); > for (unsigned i = 0; i < nodeCount; i++) { > WebKitDOMNode* node = webkit_dom_node_list_item(list.get(), i); >- g_assert(WEBKIT_DOM_IS_NODE(node)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > GUniquePtr<char> tagName(webkit_dom_node_get_node_name(node)); > g_assert_cmpstr(tagName.get(), ==, expectedTagNames[i]); >@@ -209,17 +209,17 @@ private: > static const char* expectedTagNames[] = { "HTML", "HEAD", "BODY", "VIDEO", "SOURCE", "VIDEO", "SOURCE", "INPUT" }; > > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > GRefPtr<WebKitDOMHTMLCollection> collection = adoptGRef(webkit_dom_document_get_elements_by_tag_name_as_html_collection(document, "*")); >- g_assert(WEBKIT_DOM_IS_HTML_COLLECTION(collection.get())); >+ g_assert_true(WEBKIT_DOM_IS_HTML_COLLECTION(collection.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(collection.get())); > gulong nodeCount = webkit_dom_html_collection_get_length(collection.get()); > g_assert_cmpuint(nodeCount, ==, G_N_ELEMENTS(expectedTagNames)); > for (unsigned i = 0; i < nodeCount; i++) { > WebKitDOMNode* node = webkit_dom_html_collection_item(collection.get(), i); >- g_assert(WEBKIT_DOM_IS_NODE(node)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(node)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(node)); > GUniquePtr<char> tagName(webkit_dom_node_get_node_name(node)); > g_assert_cmpstr(tagName.get(), ==, expectedTagNames[i]); >@@ -231,41 +231,41 @@ private: > bool testDOMCache(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > // DOM objects already in the document should be automatically handled by the cache. > WebKitDOMElement* div = webkit_dom_document_get_element_by_id(document, "container"); >- g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(div)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_ELEMENT(div)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(div)); > > // Get the same elment twice should return the same pointer. >- g_assert(div == webkit_dom_document_get_element_by_id(document, "container")); >+ g_assert_true(div == webkit_dom_document_get_element_by_id(document, "container")); > > // A new DOM object created that is derived from Node should be automatically handled by the cache. > WebKitDOMElement* p = webkit_dom_document_create_element(document, "P", nullptr); >- g_assert(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p)); >+ g_assert_true(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p)); > > // A new DOM object created that isn't derived from Node should be manually handled. > GRefPtr<WebKitDOMNodeIterator> iter = adoptGRef(webkit_dom_document_create_node_iterator(document, WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE_FILTER_SHOW_ALL, nullptr, FALSE, nullptr)); >- g_assert(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); >+ g_assert_true(WEBKIT_DOM_IS_NODE_ITERATOR(iter.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(iter.get())); > > // We can also manually handle a DOM object handled by the cache. > GRefPtr<WebKitDOMElement> p2 = adoptGRef(webkit_dom_document_create_element(document, "P", nullptr)); >- g_assert(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p2.get())); >+ g_assert_true(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p2.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p2.get())); > > // Manually handling a DOM object owned by the cache shouldn't crash when the cache has more than one reference. > GRefPtr<WebKitDOMElement> p3 = adoptGRef(webkit_dom_document_create_element(document, "P", nullptr)); >- g_assert(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p3.get())); >+ g_assert_true(WEBKIT_DOM_IS_HTML_PARAGRAPH_ELEMENT(p3.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(p3.get())); > webkit_dom_node_append_child(WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE(p3.get()), nullptr); > > // DOM objects removed from the document are also correctly handled by the cache. > WebKitDOMElement* a = webkit_dom_document_create_element(document, "A", nullptr); >- g_assert(WEBKIT_DOM_IS_ELEMENT(a)); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(a)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(a)); > webkit_dom_node_remove_child(WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE(a), nullptr); > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >index ebb8f3924a21879c5abdd04f4e379a4d3ab7f1ac..35ee3503a40aaa13baa8adc088923cf920e8d78b 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/DOMXPathNSResolverTest.cpp >@@ -65,15 +65,15 @@ private: > void evaluateFooChildTextAndCheckResult(WebKitDOMDocument* document, WebKitDOMXPathNSResolver* resolver) > { > WebKitDOMElement* documentElement = webkit_dom_document_get_document_element(document); >- g_assert(WEBKIT_DOM_IS_ELEMENT(documentElement)); >+ g_assert_true(WEBKIT_DOM_IS_ELEMENT(documentElement)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(documentElement)); > > GRefPtr<WebKitDOMXPathResult> result = adoptGRef(webkit_dom_document_evaluate(document, "foo:child/text()", WEBKIT_DOM_NODE(documentElement), resolver, WEBKIT_DOM_XPATH_RESULT_ORDERED_NODE_ITERATOR_TYPE, nullptr, nullptr)); >- g_assert(WEBKIT_DOM_IS_XPATH_RESULT(result.get())); >+ g_assert_true(WEBKIT_DOM_IS_XPATH_RESULT(result.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(result.get())); > > WebKitDOMNode* nodeResult = webkit_dom_xpath_result_iterate_next(result.get(), nullptr); >- g_assert(WEBKIT_DOM_IS_NODE(nodeResult)); >+ g_assert_true(WEBKIT_DOM_IS_NODE(nodeResult)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(nodeResult)); > > GUniquePtr<char> nodeValue(webkit_dom_node_get_node_value(nodeResult)); >@@ -83,11 +83,11 @@ private: > bool testXPathNSResolverNative(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > GRefPtr<WebKitDOMXPathNSResolver> resolver = adoptGRef(webkit_dom_document_create_ns_resolver(document, WEBKIT_DOM_NODE(webkit_dom_document_get_document_element(document)))); >- g_assert(WEBKIT_DOM_IS_XPATH_NS_RESOLVER(resolver.get())); >+ g_assert_true(WEBKIT_DOM_IS_XPATH_NS_RESOLVER(resolver.get())); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(resolver.get())); > evaluateFooChildTextAndCheckResult(document, resolver.get()); > >@@ -97,7 +97,7 @@ private: > bool testXPathNSResolverCustom(WebKitWebPage* page) > { > WebKitDOMDocument* document = webkit_web_page_get_dom_document(page); >- g_assert(WEBKIT_DOM_IS_DOCUMENT(document)); >+ g_assert_true(WEBKIT_DOM_IS_DOCUMENT(document)); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document)); > > GRefPtr<WebKitDOMXPathNSResolver> resolver = adoptGRef(WEBKIT_DOM_XPATH_NS_RESOLVER(g_object_new(webkit_xpath_ns_resolver_get_type(), nullptr))); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp >index 50e82a9c6f5a4e496934dfb1a503e1857d5d4b59..853077c8a772a750abe2cc740aadc0f3ba9f7efc 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestAutocleanups.cpp >@@ -28,23 +28,23 @@ static void testUIProcessAutocleanups(WebViewTest* test, gconstpointer) > { > // Sanity-check a couple UI process API autocleanups that are easy to test.... > g_autoptr(WebKitWebContext) context = webkit_web_context_new(); >- g_assert(WEBKIT_IS_WEB_CONTEXT(context)); >+ g_assert_true(WEBKIT_IS_WEB_CONTEXT(context)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(context)); > > g_autoptr(WebKitWebsiteDataManager) manager = webkit_website_data_manager_new(nullptr); >- g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); >+ g_assert_true(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(context)); > > g_autoptr(WebKitUserScript) userScript = webkit_user_script_new("", > WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START, > nullptr, nullptr); >- g_assert(userScript); >+ g_assert_nonnull(userScript); > // Not a GObject, so just checking that this doesn't crash.... > } > > static void testWebProcessAutocleanups(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("Autocleanups", "web-process-autocleanups")); >+ g_assert_true(test->runWebProcessTest("Autocleanups", "web-process-autocleanups")); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >index d93d5b244dfde14719410368667073021c4fcd5c..1a8842e9e279069f1a252e440bf9b691bba463f5 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >@@ -32,7 +32,7 @@ public: > > void checkContextMenuEvent(GdkEvent* event) > { >- g_assert(event); >+ g_assert_nonnull(event); > g_assert_cmpint(event->type, ==, m_expectedEventType); > > switch (m_expectedEventType) { >@@ -55,10 +55,10 @@ public: > > static gboolean contextMenuCallback(WebKitWebView* webView, WebKitContextMenu* contextMenu, GdkEvent* event, WebKitHitTestResult* hitTestResult, ContextMenuTest* test) > { >- g_assert(WEBKIT_IS_CONTEXT_MENU(contextMenu)); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU(contextMenu)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(contextMenu)); > test->checkContextMenuEvent(event); >- g_assert(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); >+ g_assert_true(WEBKIT_IS_HIT_TEST_RESULT(hitTestResult)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(hitTestResult)); > > return test->contextMenu(contextMenu, event, hitTestResult); >@@ -111,38 +111,38 @@ public: > void checkActionState(GtkAction* action, unsigned state) > { > if (state & Visible) >- g_assert(gtk_action_get_visible(action)); >+ g_assert_true(gtk_action_get_visible(action)); > else >- g_assert(!gtk_action_get_visible(action)); >+ g_assert_false(gtk_action_get_visible(action)); > > if (state & Enabled) >- g_assert(gtk_action_get_sensitive(action)); >+ g_assert_true(gtk_action_get_sensitive(action)); > else >- g_assert(!gtk_action_get_sensitive(action)); >+ g_assert_false(gtk_action_get_sensitive(action)); > > if (GTK_IS_TOGGLE_ACTION(action)) { > if (state & Checked) >- g_assert(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); >+ g_assert_true(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); > else >- g_assert(!gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); >+ g_assert_false(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); > } > } > > GList* checkCurrentItemIsStockActionAndGetNext(GList* items, WebKitContextMenuAction stockAction, unsigned state) > { >- g_assert(items); >- g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); >+ g_assert_nonnull(items); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); > > WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(item)); > > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > GtkAction* action = webkit_context_menu_item_get_action(item); >- g_assert(GTK_IS_ACTION(action)); >+ g_assert_true(GTK_IS_ACTION(action)); > G_GNUC_END_IGNORE_DEPRECATIONS; > > GAction* gAction = webkit_context_menu_item_get_gaction(item); >- g_assert(G_IS_ACTION(gAction)); >+ g_assert_true(G_IS_ACTION(gAction)); > > g_assert_cmpint(webkit_context_menu_item_get_stock_action(item), ==, stockAction); > >@@ -153,27 +153,27 @@ public: > > GList* checkCurrentItemIsCustomActionAndGetNext(GList* items, const char* label, unsigned state) > { >- g_assert(items); >- g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); >+ g_assert_nonnull(items); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); > > WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(item)); > > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > GtkAction* action = webkit_context_menu_item_get_action(item); >- g_assert(GTK_IS_ACTION(action)); >+ g_assert_true(GTK_IS_ACTION(action)); > G_GNUC_END_IGNORE_DEPRECATIONS; > > GAction* gAction = webkit_context_menu_item_get_gaction(item); >- g_assert(G_IS_ACTION(gAction)); >+ g_assert_true(G_IS_ACTION(gAction)); > g_assert_cmpstr(gtk_action_get_name(action), ==, g_action_get_name(gAction)); >- g_assert(gtk_action_get_sensitive(action) == g_action_get_enabled(gAction)); >+ g_assert_cmpint(gtk_action_get_sensitive(action), ==, g_action_get_enabled(gAction)); > if (GTK_IS_TOGGLE_ACTION(action)) { >- g_assert(g_variant_type_equal(g_action_get_state_type(gAction), G_VARIANT_TYPE_BOOLEAN)); >+ g_assert_true(g_variant_type_equal(g_action_get_state_type(gAction), G_VARIANT_TYPE_BOOLEAN)); > GRefPtr<GVariant> state = adoptGRef(g_action_get_state(gAction)); >- g_assert(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) == g_variant_get_boolean(state.get())); >+ g_assert_cmpint(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)), ==, g_variant_get_boolean(state.get())); > } else >- g_assert(!g_action_get_state_type(gAction)); >+ g_assert_null(g_action_get_state_type(gAction)); > > g_assert_cmpint(webkit_context_menu_item_get_stock_action(item), ==, WEBKIT_CONTEXT_MENU_ACTION_CUSTOM); > g_assert_cmpstr(gtk_action_get_label(action), ==, label); >@@ -185,25 +185,25 @@ public: > > GList* checkCurrentItemIsSubMenuAndGetNext(GList* items, const char* label, unsigned state, GList** subMenuIter) > { >- g_assert(items); >- g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); >+ g_assert_nonnull(items); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); > > WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(item)); > > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > GtkAction* action = webkit_context_menu_item_get_action(item); >- g_assert(GTK_IS_ACTION(action)); >+ g_assert_true(GTK_IS_ACTION(action)); > g_assert_cmpstr(gtk_action_get_label(action), ==, label); > G_GNUC_END_IGNORE_DEPRECATIONS; > > GAction* gAction = webkit_context_menu_item_get_gaction(item); >- g_assert(G_IS_ACTION(gAction)); >+ g_assert_true(G_IS_ACTION(gAction)); > > checkActionState(action, state); > > WebKitContextMenu* subMenu = webkit_context_menu_item_get_submenu(item); >- g_assert(WEBKIT_IS_CONTEXT_MENU(subMenu)); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU(subMenu)); > if (subMenuIter) > *subMenuIter = webkit_context_menu_get_items(subMenu); > >@@ -212,11 +212,11 @@ public: > > GList* checkCurrentItemIsSeparatorAndGetNext(GList* items) > { >- g_assert(items); >- g_assert(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); >+ g_assert_nonnull(items); >+ g_assert_true(WEBKIT_IS_CONTEXT_MENU_ITEM(items->data)); > > WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(items->data); >- g_assert(webkit_context_menu_item_is_separator(item)); >+ g_assert_true(webkit_context_menu_item_is_separator(item)); > > return g_list_next(items); > } >@@ -310,44 +310,44 @@ public: > > switch (m_expectedMenuType) { > case Navigation: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_GO_BACK, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_GO_FORWARD, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_STOP, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_RELOAD, Visible | Enabled); > break; > case Link: >- g_assert(webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK_IN_NEW_WINDOW, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_LINK_TO_DISK, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_LINK_TO_CLIPBOARD, Visible | Enabled); > break; > case Image: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_IMAGE_IN_NEW_WINDOW, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_IMAGE_TO_DISK, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_IMAGE_TO_CLIPBOARD, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_IMAGE_URL_TO_CLIPBOARD, Visible | Enabled); > break; > case LinkImage: >- g_assert(webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK_IN_NEW_WINDOW, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_LINK_TO_DISK, Visible | Enabled); >@@ -359,11 +359,11 @@ public: > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY_IMAGE_URL_TO_CLIPBOARD, Visible | Enabled); > break; > case Video: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS, Visible | Enabled | Checked); >@@ -375,11 +375,11 @@ public: > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_VIDEO_TO_DISK, Visible | Enabled); > break; > case Audio: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_PLAY, Visible | Enabled); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_MEDIA_MUTE, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_TOGGLE_MEDIA_CONTROLS, Visible | Enabled | Checked); >@@ -391,11 +391,11 @@ public: > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_DOWNLOAD_AUDIO_TO_DISK, Visible | Enabled); > break; > case Editable: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_CUT, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY, Visible); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_PASTE, Visible | Enabled); >@@ -406,11 +406,11 @@ public: > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_UNICODE, Visible | Enabled); > break; > case Selection: >- g_assert(!webkit_hit_test_result_context_is_link(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_image(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_media(hitTestResult)); >- g_assert(!webkit_hit_test_result_context_is_editable(hitTestResult)); >- g_assert(webkit_hit_test_result_context_is_selection(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_link(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_image(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_media(hitTestResult)); >+ g_assert_false(webkit_hit_test_result_context_is_editable(hitTestResult)); >+ g_assert_true(webkit_hit_test_result_context_is_selection(hitTestResult)); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_COPY, Visible | Enabled); > break; > default: >@@ -421,7 +421,7 @@ public: > iter = checkCurrentItemIsSeparatorAndGetNext(iter); > iter = checkCurrentItemIsStockActionAndGetNext(iter, WEBKIT_CONTEXT_MENU_ACTION_INSPECT_ELEMENT, Visible | Enabled); > } >- g_assert(!iter); >+ g_assert_null(iter); > > quitMainLoop(); > >@@ -550,7 +550,7 @@ public: > > void activateMenuItem() > { >- g_assert(m_itemToActivateLabel); >+ g_assert_nonnull(m_itemToActivateLabel); > GtkMenu* menu = getPopupMenu(); > GtkMenuItem* item = getMenuItem(menu, m_itemToActivateLabel); > gtk_menu_shell_activate_item(GTK_MENU_SHELL(menu), GTK_WIDGET(item), TRUE); >@@ -586,9 +586,9 @@ public: > } else { > test->m_activated = true; > if (test->m_expectedTarget) >- g_assert(g_variant_equal(test->m_expectedTarget.get(), target)); >+ g_assert_true(g_variant_equal(test->m_expectedTarget.get(), target)); > else >- g_assert(!target); >+ g_assert_null(target); > } > } else > test->m_activated = true; >@@ -642,39 +642,39 @@ static void testContextMenuPopulateMenu(ContextMenuCustomTest* test, gconstpoint > test->setAction(action.get()); > test->showContextMenuAndWaitUntilFinished(); > test->activateCustomMenuItemAndWaitUntilActivated(gtk_action_get_label(action.get())); >- g_assert(test->m_activated); >- g_assert(!test->m_toggled); >+ g_assert_true(test->m_activated); >+ g_assert_false(test->m_toggled); > > // Create a custom toggle menu item. > GRefPtr<GtkAction> toggleAction = adoptGRef(GTK_ACTION(gtk_toggle_action_new("WebKitGTK+CustomToggleAction", "Custom _Toggle Action", nullptr, nullptr))); > test->setAction(toggleAction.get()); > test->showContextMenuAndWaitUntilFinished(); > test->toggleCustomMenuItemAndWaitUntilToggled(gtk_action_get_label(toggleAction.get())); >- g_assert(!test->m_activated); >- g_assert(test->m_toggled); >+ g_assert_false(test->m_activated); >+ g_assert_true(test->m_toggled); > > // Create a custom menu item using GAction. > GRefPtr<GAction> gAction = adoptGRef(G_ACTION(g_simple_action_new("WebKitGTK+CustomGAction", nullptr))); > test->setAction(gAction.get(), "Custom _GAction"); > test->showContextMenuAndWaitUntilFinished(); > test->activateCustomMenuItemAndWaitUntilActivated("Custom _GAction"); >- g_assert(test->m_activated); >- g_assert(!test->m_toggled); >+ g_assert_true(test->m_activated); >+ g_assert_false(test->m_toggled); > > // Create a custom toggle menu item using GAction. > GRefPtr<GAction> toggleGAction = adoptGRef(G_ACTION(g_simple_action_new_stateful("WebKitGTK+CustomToggleGAction", nullptr, g_variant_new_boolean(FALSE)))); > test->setAction(toggleGAction.get(), "Custom _Toggle GAction"); > test->showContextMenuAndWaitUntilFinished(); > test->toggleCustomMenuItemAndWaitUntilToggled("Custom _Toggle GAction"); >- g_assert(!test->m_activated); >- g_assert(test->m_toggled); >+ g_assert_false(test->m_activated); >+ g_assert_true(test->m_toggled); > > // Create a custom menu item using GAction with a target. > gAction = adoptGRef(G_ACTION(g_simple_action_new("WebKitGTK+CustomGActionWithTarget", G_VARIANT_TYPE_STRING))); > test->setAction(gAction.get(), "Custom _GAction With Target", g_variant_new_string("WebKitGTK+CustomGActionTarget")); > test->showContextMenuAndWaitUntilFinished(); > test->activateCustomMenuItemAndWaitUntilActivated("Custom _GAction With Target"); >- g_assert(test->m_activated); >+ g_assert_true(test->m_activated); > } > > class ContextMenuCustomFullTest: public ContextMenuTest { >@@ -743,7 +743,7 @@ public: > iter = checkCurrentItemIsSeparatorAndGetNext(iter); > iter = checkCurrentItemIsCustomActionAndGetNext(iter, "Custom _GAction", Visible); > iter = checkCurrentItemIsCustomActionAndGetNext(iter, "Custom T_oggle GAction", Visible | Enabled | Checked); >- g_assert(!iter); >+ g_assert_null(iter); > > quitMainLoop(); > >@@ -834,23 +834,23 @@ public: > GRefPtr<WebKitContextMenuItem> item = webkit_context_menu_item_new_from_stock_action(WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK); > > // Add submenu to newly created item. >- g_assert(!webkit_context_menu_item_get_submenu(item.get())); >+ g_assert_null(webkit_context_menu_item_get_submenu(item.get())); > webkit_context_menu_item_set_submenu(item.get(), subMenu2.get()); >- g_assert(webkit_context_menu_item_get_submenu(item.get()) == subMenu2.get()); >+ g_assert_cmphex(webkit_context_menu_item_get_submenu(item.get()), ==, subMenu2.get()); > > // Replace the submenu. > webkit_context_menu_item_set_submenu(item.get(), 0); >- g_assert(!webkit_context_menu_item_get_submenu(item.get())); >+ g_assert_null(webkit_context_menu_item_get_submenu(item.get())); > > // Try to add a submenu already added to another item. > removeLogFatalFlag(G_LOG_LEVEL_WARNING); > webkit_context_menu_item_set_submenu(item.get(), subMenu.get()); > addLogFatalFlag(G_LOG_LEVEL_WARNING); >- g_assert(!webkit_context_menu_item_get_submenu(item.get())); >+ g_assert_null(webkit_context_menu_item_get_submenu(item.get())); > > // A removed submenu shouldn't have a parent. > webkit_context_menu_item_set_submenu(item.get(), subMenu2.get()); >- g_assert(webkit_context_menu_item_get_submenu(item.get()) == subMenu2.get()); >+ g_assert_cmphex(webkit_context_menu_item_get_submenu(item.get()), ==, subMenu2.get()); > > quitMainLoop(); > >@@ -907,7 +907,7 @@ static void testContextMenuDismissed(ContextMenuDismissedTest* test, gconstpoint > test->waitUntilLoadFinished(); > > test->showContextMenuAndWaitUntilDismissed(); >- g_assert(test->m_dismissed); >+ g_assert_true(test->m_dismissed); > } > > class ContextMenuWebExtensionTest: public ContextMenuTest { >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp >index ffb474715379a0eec6b84617978f9227cbfc9b32..01c8073e677019878f751d74205d57e58f26452d 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMClientRect.cpp >@@ -30,12 +30,12 @@ static const char* testHTML = "<html><head></head><body>" > > static void testWebKitDOMClientRectDivBoundingClientRectPosition(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMClientRect", "div-bounding-client-rect-position", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMClientRect", "div-bounding-client-rect-position", testHTML)); > } > > static void testWebKitDOMClientRectDivClientRectsPositionAndLength(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMClientRect", "div-client-rects-position-and-length", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMClientRect", "div-client-rects-position-and-length", testHTML)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMDOMWindow.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMDOMWindow.cpp >index 98c6e10641f59d8f2fc4baa9551cb9a6e4e72bda..550a5976e14b1fab6add5d6bb4be1844637a2f89 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMDOMWindow.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMDOMWindow.cpp >@@ -99,7 +99,7 @@ static void testWebKitDOMDOMWindowSignals(WebViewTest* test, gconstpointer) > g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); > g_variant_builder_add(&builder, "{sv}", "pageID", g_variant_new_uint64(webkit_web_view_get_page_id(status.test->m_webView))); > status.testRunner->runTestAndWait("WebKitDOMDOMWindow", "signals", g_variant_builder_end(&builder)); >- g_assert(status.testRunner->getTestResult()); >+ g_assert_true(status.testRunner->getTestResult()); > } > > static void testWebKitDOMDOMWindowDispatchEvent(WebViewTest* test, gconstpointer) >@@ -117,7 +117,7 @@ static void testWebKitDOMDOMWindowDispatchEvent(WebViewTest* test, gconstpointer > g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); > g_variant_builder_add(&builder, "{sv}", "pageID", g_variant_new_uint64(webkit_web_view_get_page_id(status.test->m_webView))); > status.testRunner->runTestAndWait("WebKitDOMDOMWindow", "dispatch-event", g_variant_builder_end(&builder)); >- g_assert(status.testRunner->getTestResult()); >+ g_assert_true(status.testRunner->getTestResult()); > } > > static void testWebKitDOMDOMWindowGetComputedStyle(WebViewTest* test, gconstpointer) >@@ -133,7 +133,7 @@ static void testWebKitDOMDOMWindowGetComputedStyle(WebViewTest* test, gconstpoin > GVariantBuilder builder; > g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); > g_variant_builder_add(&builder, "{sv}", "pageID", g_variant_new_uint64(webkit_web_view_get_page_id(status.test->m_webView))); >- g_assert(status.testRunner->runTest("WebKitDOMDOMWindow", "get-computed-style", g_variant_builder_end(&builder))); >+ g_assert_true(status.testRunner->runTest("WebKitDOMDOMWindow", "get-computed-style", g_variant_builder_end(&builder))); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp >index 46e0dabe5063811ee47e7065815b224ff0bb2bf7..a698a27e27c4ba35766742e4ab9bc8e2f6eeab58 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNode.cpp >@@ -26,12 +26,12 @@ > static void testWebKitDOMNodeHierarchyNavigation(WebViewTest* test, gconstpointer) > { > static const char* testHTML = "<html><head><title>This is the title</title></head><body><p>1</p><p>2</p><p>3</p></body></html>"; >- g_assert(test->runWebProcessTest("WebKitDOMNode", "hierarchy-navigation", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNode", "hierarchy-navigation", testHTML)); > } > > static void testWebKitDOMNodeInsertion(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMNode", "insertion")); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNode", "insertion")); > } > > static const char* tagNamesTestHTML = "<html><head></head><body>" >@@ -47,18 +47,18 @@ static const char* tagNamesTestHTML = "<html><head></head><body>" > > static void testWebKitDOMNodeTagNamesNodeList(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMNode", "tag-names-node-list", tagNamesTestHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNode", "tag-names-node-list", tagNamesTestHTML)); > } > > static void testWebKitDOMNodeTagNamesHTMLCollection(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMNode", "tag-names-html-collection", tagNamesTestHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNode", "tag-names-html-collection", tagNamesTestHTML)); > } > > static void testWebKitDOMObjectCache(WebViewTest* test, gconstpointer) > { > static const char* testHTML = "<html><body><div id='container'><p>DOM Cache test</p><a id='link href='#'>link</a></div></body></html>"; >- g_assert(test->runWebProcessTest("WebKitDOMNode", "dom-cache", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNode", "dom-cache", testHTML)); > } > > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp >index e0c0add88ea28aecc6f835eca52054ba5347cc05..0daf479fb899d117674bc2ea3eb1951670f138be 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMNodeFilter.cpp >@@ -28,12 +28,12 @@ static const char* testHTML = "<html id='root'><head><title>DOMNodeTreeWalker</t > > static void testWebKitDOMNodeFilterTreeWalker(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMNodeFilter", "tree-walker", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNodeFilter", "tree-walker", testHTML)); > } > > static void testWebKitDOMNodeFilterNodeIterator(WebViewTest* test, gconstpointer) > { >- g_assert(test->runWebProcessTest("WebKitDOMNodeFilter", "node-iterator", testHTML)); >+ g_assert_true(test->runWebProcessTest("WebKitDOMNodeFilter", "node-iterator", testHTML)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp >index 63edf46cc46a2343f5e18a904b47c9e112bd6e74..22d79f15eef98166c4eea1c0a3915423432579a1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestDOMXPathNSResolver.cpp >@@ -26,13 +26,13 @@ > static void testWebKitDOMXPathNSResolverNative(WebViewTest* test, gconstpointer) > { > static const char* nativeXML = "<root xmlns:foo='http://www.example.org'><foo:child>SUCCESS</foo:child></root>"; >- g_assert(test->runWebProcessTest("WebKitDOMXPathNSResolver", "native", nativeXML, "text/xml")); >+ g_assert_true(test->runWebProcessTest("WebKitDOMXPathNSResolver", "native", nativeXML, "text/xml")); > } > > static void testWebKitDOMXPathNSResolverCustom(WebViewTest* test, gconstpointer) > { > static const char* customXML = "<root xmlns='http://www.example.com'><child>SUCCESS</child></root>"; >- g_assert(test->runWebProcessTest("WebKitDOMXPathNSResolver", "custom", customXML, "text/xml")); >+ g_assert_true(test->runWebProcessTest("WebKitDOMXPathNSResolver", "custom", customXML, "text/xml")); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp >index 3d993e24f1b48e77ef79f6f9e80a22beb90e27a0..133b24e3c8b0c139dd3f148d2a4ea080d1e42bf6 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspector.cpp >@@ -140,7 +140,7 @@ public: > g_signal_handler_disconnect(m_inspector, handler); > } > >- g_assert(webkit_web_inspector_get_can_attach(m_inspector)); >+ g_assert_true(webkit_web_inspector_get_can_attach(m_inspector)); > webkit_web_inspector_attach(m_inspector); > } > >@@ -175,11 +175,11 @@ static void testInspectorDefault(InspectorTest* test, gconstpointer) > test->show(); > // We don't add the view to a container, so consume the weak ref with GRefPtr. > GRefPtr<WebKitWebViewBase> inspectorView = webkit_web_inspector_get_web_view(test->m_inspector); >- g_assert(inspectorView.get()); >+ g_assert_nonnull(inspectorView.get()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(inspectorView.get())); >- g_assert(!webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_is_attached(test->m_inspector)); > g_assert_cmpuint(webkit_web_inspector_get_attached_height(test->m_inspector), ==, 0); >- g_assert(!webkit_web_inspector_get_can_attach(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_get_can_attach(test->m_inspector)); > Vector<InspectorTest::InspectorEvents>& events = test->m_events; > g_assert_cmpint(events.size(), ==, 1); > g_assert_cmpint(events[0], ==, InspectorTest::OpenWindow); >@@ -192,7 +192,7 @@ static void testInspectorDefault(InspectorTest* test, gconstpointer) > test->m_events.clear(); > > test->resizeViewAndAttach(); >- g_assert(webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_true(webkit_web_inspector_is_attached(test->m_inspector)); > g_assert_cmpuint(webkit_web_inspector_get_attached_height(test->m_inspector), >=, InspectorTest::gMinimumAttachedInspectorHeight); > events = test->m_events; > g_assert_cmpint(events.size(), ==, 1); >@@ -200,7 +200,7 @@ static void testInspectorDefault(InspectorTest* test, gconstpointer) > test->m_events.clear(); > > test->detachAndWaitUntilWindowOpened(); >- g_assert(!webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_is_attached(test->m_inspector)); > events = test->m_events; > g_assert_cmpint(events.size(), ==, 2); > g_assert_cmpint(events[0], ==, InspectorTest::Detach); >@@ -232,10 +232,10 @@ public: > > bool openWindow() > { >- g_assert(!m_inspectorWindow); >+ g_assert_null(m_inspectorWindow); > m_inspectorWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); > WebKitWebViewBase* inspectorView = webkit_web_inspector_get_web_view(m_inspector); >- g_assert(inspectorView); >+ g_assert_nonnull(inspectorView); > gtk_container_add(GTK_CONTAINER(m_inspectorWindow), GTK_WIDGET(inspectorView)); > gtk_widget_show_all(m_inspectorWindow); > >@@ -281,14 +281,14 @@ public: > { > GRefPtr<WebKitWebViewBase> inspectorView = webkit_web_inspector_get_web_view(m_inspector); > GtkWidget* pane = gtk_bin_get_child(GTK_BIN(m_parentWindow)); >- g_assert(GTK_IS_PANED(pane)); >+ g_assert_true(GTK_IS_PANED(pane)); > gtk_container_remove(GTK_CONTAINER(pane), GTK_WIDGET(inspectorView.get())); > return InspectorTest::detach(); > } > > void destroyWindow() > { >- g_assert(m_inspectorWindow); >+ g_assert_nonnull(m_inspectorWindow); > gtk_widget_destroy(m_inspectorWindow); > m_inspectorWindow = 0; > } >@@ -305,14 +305,14 @@ static void testInspectorManualAttachDetach(CustomInspectorTest* test, gconstpoi > > test->show(); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_web_inspector_get_web_view(test->m_inspector))); >- g_assert(!webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_is_attached(test->m_inspector)); > Vector<InspectorTest::InspectorEvents>& events = test->m_events; > g_assert_cmpint(events.size(), ==, 1); > g_assert_cmpint(events[0], ==, InspectorTest::OpenWindow); > test->m_events.clear(); > > test->resizeViewAndAttach(); >- g_assert(webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_true(webkit_web_inspector_is_attached(test->m_inspector)); > g_assert_cmpuint(webkit_web_inspector_get_attached_height(test->m_inspector), >=, InspectorTest::gMinimumAttachedInspectorHeight); > events = test->m_events; > g_assert_cmpint(events.size(), ==, 1); >@@ -320,7 +320,7 @@ static void testInspectorManualAttachDetach(CustomInspectorTest* test, gconstpoi > test->m_events.clear(); > > test->detachAndWaitUntilWindowOpened(); >- g_assert(!webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_is_attached(test->m_inspector)); > events = test->m_events; > g_assert_cmpint(events.size(), ==, 2); > g_assert_cmpint(events[0], ==, InspectorTest::Detach); >@@ -328,7 +328,7 @@ static void testInspectorManualAttachDetach(CustomInspectorTest* test, gconstpoi > test->m_events.clear(); > > test->resizeViewAndAttach(); >- g_assert(webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_true(webkit_web_inspector_is_attached(test->m_inspector)); > test->m_events.clear(); > test->close(); > events = test->m_events; >@@ -347,7 +347,7 @@ static void testInspectorCustomContainerDestroyed(CustomInspectorTest* test, gco > > test->show(); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(webkit_web_inspector_get_web_view(test->m_inspector))); >- g_assert(!webkit_web_inspector_is_attached(test->m_inspector)); >+ g_assert_false(webkit_web_inspector_is_attached(test->m_inspector)); > > test->m_events.clear(); > test->destroyWindow(); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp >index 93a91d81d2680d47f3db2bcb42715339e418b7b4..bc26143e157484acb1de640545c352141f418987 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp >@@ -99,7 +99,7 @@ static void startTestServer() > testServerArgv[0] = testServerPath.get(); > testServerArgv[1] = nullptr; > >- g_assert(g_spawn_async(nullptr, testServerArgv, nullptr, G_SPAWN_DEFAULT, nullptr, nullptr, &gChildProcessPid, nullptr)); >+ g_assert_true(g_spawn_async(nullptr, testServerArgv, nullptr, G_SPAWN_DEFAULT, nullptr, nullptr, &gChildProcessPid, nullptr)); > > waitUntilInspectorServerIsReady(); > if (!gServerIsReady) >@@ -117,7 +117,7 @@ public: > for (unsigned i = 0; i < 5; ++i) { > size_t mainResourceDataSize = 0; > const char* mainResourceData = this->mainResourceData(mainResourceDataSize); >- g_assert(mainResourceData); >+ g_assert_nonnull(mainResourceData); > if (g_strrstr_len(mainResourceData, mainResourceDataSize, "No targets found")) > wait(0.1); > else if (g_strrstr_len(mainResourceData, mainResourceDataSize, "Inspectable targets")) >@@ -135,17 +135,17 @@ static void testInspectorServerPageList(InspectorServerTest* test, gconstpointer > GUniqueOutPtr<GError> error; > > test->showInWindowAndWaitUntilMapped(GTK_WINDOW_TOPLEVEL); >- g_assert(test->getPageList()); >+ g_assert_true(test->getPageList()); > > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByClassName('targetname').length;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > g_assert_cmpint(WebViewTest::javascriptResultToNumber(javascriptResult), ==, 1); > > GUniquePtr<char> valueString; > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByClassName('targeturl')[0].innerText;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error.get()); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > valueString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(valueString.get(), ==, "http://127.0.0.1:2999/"); > } >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestOptionMenu.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestOptionMenu.cpp >index ea61bc4d2a4b8b86fbcc9b3051a3e9dcfae2fea5..c50dd0501bf72404c350d87761f216ec819d51f3 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestOptionMenu.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestOptionMenu.cpp >@@ -49,9 +49,9 @@ public: > > static gboolean showOptionMenuCallback(WebKitWebView* webView, WebKitOptionMenu* menu, GdkEvent* event, GdkRectangle* rect, OptionMenuTest* test) > { >- g_assert(test->m_webView == webView); >- g_assert(rect); >- g_assert(WEBKIT_IS_OPTION_MENU(menu)); >+ g_assert_cmphex(test->m_webView, ==, webView); >+ g_assert_nonnull(rect); >+ g_assert_true(WEBKIT_IS_OPTION_MENU(menu)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(menu)); > test->showOptionMenu(menu, rect); > return TRUE; >@@ -59,7 +59,7 @@ public: > > static void menuCloseCallback(WebKitOptionMenu* menu, OptionMenuTest* test) > { >- g_assert(test->m_menu.get() == menu); >+ g_assert_cmphex(test->m_menu.get(), ==, menu); > test->destroyMenu(); > } > >@@ -80,23 +80,23 @@ public: > > void close() > { >- g_assert(m_menu.get()); >+ g_assert_nonnull(m_menu.get()); > webkit_option_menu_close(m_menu.get()); >- g_assert(!m_menu.get()); >+ g_assert_null(m_menu.get()); > } > > void activateItem(unsigned item) > { >- g_assert(m_menu.get()); >+ g_assert_nonnull(m_menu.get()); > webkit_option_menu_activate_item(m_menu.get(), item); >- g_assert(m_menu.get()); >+ g_assert_nonnull(m_menu.get()); > } > > void selectItem(unsigned item) > { >- g_assert(m_menu.get()); >+ g_assert_nonnull(m_menu.get()); > webkit_option_menu_select_item(m_menu.get(), item); >- g_assert(m_menu.get()); >+ g_assert_nonnull(m_menu.get()); > } > > GRefPtr<WebKitOptionMenu> m_menu; >@@ -117,32 +117,32 @@ static void testOptionMenuSimple(OptionMenuTest* test, gconstpointer) > test->waitUntilLoadFinished(); > > test->clickAtPositionAndWaitUntilOptionMenuShown(5, 15); >- g_assert(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); >+ g_assert_true(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); > g_assert_cmpint(webkit_option_menu_get_n_items(test->m_menu.get()), ==, 3); > auto* item = webkit_option_menu_get_item(test->m_menu.get(), 0); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Foo"); > g_assert_cmpstr(webkit_option_menu_item_get_tooltip(item), ==, "The Foo Option"); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 1); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Bar"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_true(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 2); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Baz"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(!webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_false(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > > test->close(); >- g_assert(!test->m_menu.get()); >+ g_assert_null(test->m_menu.get()); > } > > static void testOptionMenuGroups(OptionMenuTest* test, gconstpointer) >@@ -166,64 +166,64 @@ static void testOptionMenuGroups(OptionMenuTest* test, gconstpointer) > test->waitUntilLoadFinished(); > > test->clickAtPositionAndWaitUntilOptionMenuShown(5, 15); >- g_assert(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); >+ g_assert_true(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); > g_assert_cmpint(webkit_option_menu_get_n_items(test->m_menu.get()), ==, 8); > auto* item = webkit_option_menu_get_item(test->m_menu.get(), 0); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Root"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 1); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Group 1"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(!webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_true(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_false(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 2); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Child 1-1"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_true(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 3); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Child 1-2"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(webkit_option_menu_item_is_group_child(item)); >- g_assert(!webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_true(webkit_option_menu_item_is_group_child(item)); >+ g_assert_false(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 4); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Group 2"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(!webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_true(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_false(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 5); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Child 2-1"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_true(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_true(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 6); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Child 2-2"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_true(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > item = webkit_option_menu_get_item(test->m_menu.get(), 7); > g_assert_cmpstr(webkit_option_menu_item_get_label(item), ==, "Tail"); >- g_assert(!webkit_option_menu_item_get_tooltip(item)); >- g_assert(!webkit_option_menu_item_is_group_label(item)); >- g_assert(!webkit_option_menu_item_is_group_child(item)); >- g_assert(webkit_option_menu_item_is_enabled(item)); >- g_assert(!webkit_option_menu_item_is_selected(item)); >+ g_assert_null(webkit_option_menu_item_get_tooltip(item)); >+ g_assert_false(webkit_option_menu_item_is_group_label(item)); >+ g_assert_false(webkit_option_menu_item_is_group_child(item)); >+ g_assert_true(webkit_option_menu_item_is_enabled(item)); >+ g_assert_false(webkit_option_menu_item_is_selected(item)); > } > > static void testOptionMenuActivate(OptionMenuTest* test, gconstpointer) >@@ -240,17 +240,17 @@ static void testOptionMenuActivate(OptionMenuTest* test, gconstpointer) > test->waitUntilLoadFinished(); > > test->clickAtPositionAndWaitUntilOptionMenuShown(5, 15); >- g_assert(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); >+ g_assert_true(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); > g_assert_cmpint(webkit_option_menu_get_n_items(test->m_menu.get()), ==, 3); > test->activateItem(1); > auto* result = test->runJavaScriptAndWaitUntilFinished("document.getElementById('combo').selectedIndex", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(result), ==, 1); > > // We should close the menu after activate, further activates will be ignored. > test->activateItem(2); > result = test->runJavaScriptAndWaitUntilFinished("document.getElementById('combo').selectedIndex", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(result), ==, 1); > > test->close(); >@@ -270,25 +270,25 @@ static void testOptionMenuSelect(OptionMenuTest* test, gconstpointer) > test->waitUntilLoadFinished(); > > test->clickAtPositionAndWaitUntilOptionMenuShown(5, 15); >- g_assert(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); >+ g_assert_true(WEBKIT_IS_OPTION_MENU(test->m_menu.get())); > g_assert_cmpint(webkit_option_menu_get_n_items(test->m_menu.get()), ==, 3); > > // Select item changes the combo text, but not the currently selected item. > test->selectItem(2); > auto* result = test->runJavaScriptAndWaitUntilFinished("document.getElementById('combo').selectedIndex", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(result), ==, 0); > > // It can be called multiple times. > test->selectItem(1); > result = test->runJavaScriptAndWaitUntilFinished("document.getElementById('combo').selectedIndex", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(result), ==, 0); > > // And closing the menu activates the currently selected item. > test->close(); > result = test->runJavaScriptAndWaitUntilFinished("document.getElementById('combo').selectedIndex", nullptr); >- g_assert(result); >+ g_assert_nonnull(result); > g_assert_cmpfloat(WebViewTest::javascriptResultToNumber(result), ==, 1); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp >index 710ae9c6bcbeb367aba5605886575925e9e2def1..2c8eb92a74bd20be349f3348caad3cbb5cbc3797 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestPrinting.cpp >@@ -31,8 +31,8 @@ static void testPrintOperationPrintSettings(WebViewTest* test, gconstpointer) > GRefPtr<WebKitPrintOperation> printOperation = adoptGRef(webkit_print_operation_new(test->m_webView)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printOperation.get())); > >- g_assert(!webkit_print_operation_get_print_settings(printOperation.get())); >- g_assert(!webkit_print_operation_get_page_setup(printOperation.get())); >+ g_assert_null(webkit_print_operation_get_print_settings(printOperation.get())); >+ g_assert_null(webkit_print_operation_get_page_setup(printOperation.get())); > > GRefPtr<GtkPrintSettings> printSettings = adoptGRef(gtk_print_settings_new()); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printSettings.get())); >@@ -43,19 +43,19 @@ static void testPrintOperationPrintSettings(WebViewTest* test, gconstpointer) > webkit_print_operation_set_print_settings(printOperation.get(), printSettings.get()); > webkit_print_operation_set_page_setup(printOperation.get(), pageSetup.get()); > >- g_assert(webkit_print_operation_get_print_settings(printOperation.get()) == printSettings.get()); >- g_assert(webkit_print_operation_get_page_setup(printOperation.get()) == pageSetup.get()); >+ g_assert_cmphex(webkit_print_operation_get_print_settings(printOperation.get()), ==, printSettings.get()); >+ g_assert_cmphex(webkit_print_operation_get_page_setup(printOperation.get()), ==, pageSetup.get()); > } > > static gboolean webViewPrintCallback(WebKitWebView* webView, WebKitPrintOperation* printOperation, WebViewTest* test) > { >- g_assert(webView == test->m_webView); >+ g_assert_cmphex(webView, ==, test->m_webView); > >- g_assert(WEBKIT_IS_PRINT_OPERATION(printOperation)); >+ g_assert_true(WEBKIT_IS_PRINT_OPERATION(printOperation)); > test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(printOperation)); > >- g_assert(!webkit_print_operation_get_print_settings(printOperation)); >- g_assert(!webkit_print_operation_get_page_setup(printOperation)); >+ g_assert_null(webkit_print_operation_get_print_settings(printOperation)); >+ g_assert_null(webkit_print_operation_get_page_setup(printOperation)); > > g_main_loop_quit(test->m_mainLoop); > >@@ -98,9 +98,9 @@ public: > > static void printFailedCallback(WebKitPrintOperation*, GError* error, PrintTest* test) > { >- g_assert(test->m_expectedError); >- g_assert(error); >- g_assert(g_error_matches(error, WEBKIT_PRINT_ERROR, test->m_expectedError)); >+ g_assert_cmpuint(test->m_expectedError, !=, 0); >+ g_assert_nonnull(error); >+ g_assert_error(error, WEBKIT_PRINT_ERROR, test->m_expectedError); > } > > PrintTest() >@@ -147,7 +147,7 @@ static void testPrintOperationPrint(PrintTest* test, gconstpointer) > GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_info(outputFile.get(), > G_FILE_ATTRIBUTE_STANDARD_SIZE "," G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, > static_cast<GFileQueryInfoFlags>(0), 0, 0)); >- g_assert(fileInfo.get()); >+ g_assert_nonnull(fileInfo.get()); > g_assert_cmpint(g_file_info_get_size(fileInfo.get()), >, 0); > g_assert_cmpstr(g_file_info_get_content_type(fileInfo.get()), ==, "application/pdf"); > >@@ -263,7 +263,7 @@ public: > { > m_printFinished = true; > m_printOperation = nullptr; >- g_assert(m_outputFile); >+ g_assert_nonnull(m_outputFile); > g_file_delete(m_outputFile.get(), 0, 0); > m_outputFile = nullptr; > if (m_webViewClosed) >@@ -305,7 +305,7 @@ public: > > static void updateCallback(WebKitPrintCustomWidget* customWidget, GtkPageSetup*, GtkPrintSettings*, PrintCustomWidgetTest* test) > { >- g_assert(test->m_widget == webkit_print_custom_widget_get_widget(customWidget)); >+ g_assert_cmphex(test->m_widget, ==, webkit_print_custom_widget_get_widget(customWidget)); > > test->m_updateEmitted = true; > // Would be nice to avoid the 1 second timeout here - but I didn't found >@@ -315,8 +315,8 @@ public: > > static void widgetRealizeCallback(GtkWidget* widget, PrintCustomWidgetTest* test) > { >- g_assert(GTK_IS_LABEL(widget)); >- g_assert(!g_strcmp0(gtk_label_get_text(GTK_LABEL(widget)), "Label")); >+ g_assert_true(GTK_IS_LABEL(widget)); >+ g_assert_cmpstr(gtk_label_get_text(GTK_LABEL(widget)), ==, "Label"); > > test->m_widgetRealized = true; > test->startPrinting(); >@@ -359,7 +359,7 @@ public: > > void printFinished() > { >- g_assert(m_outputFile); >+ g_assert_nonnull(m_outputFile); > g_file_delete(m_outputFile.get(), nullptr, nullptr); > m_outputFile = nullptr; > g_main_loop_quit(m_mainLoop); >@@ -368,7 +368,7 @@ public: > void createWebKitPrintOperation() > { > m_printOperation = adoptGRef(webkit_print_operation_new(m_webView)); >- g_assert(m_printOperation); >+ g_assert_nonnull(m_printOperation); > assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_printOperation.get())); > > g_signal_connect(m_printOperation.get(), "create-custom-widget", G_CALLBACK(createCustomWidgetCallback), this); >@@ -444,11 +444,11 @@ static void testPrintCustomWidget(PrintCustomWidgetTest* test, gconstpointer) > > test->openDialogMoveThroughItAndWaitUntilClosed(); > >- g_assert(test->m_response == WEBKIT_PRINT_OPERATION_RESPONSE_PRINT); >- g_assert(test->m_createEmitted); >- g_assert(test->m_widgetRealized); >- g_assert(test->m_updateEmitted); >- g_assert(test->m_applyEmitted); >+ g_assert_cmpuint(test->m_response, ==, WEBKIT_PRINT_OPERATION_RESPONSE_PRINT); >+ g_assert_true(test->m_createEmitted); >+ g_assert_true(test->m_widgetRealized); >+ g_assert_true(test->m_updateEmitted); >+ g_assert_true(test->m_applyEmitted); > } > #endif // HAVE_GTK_UNIX_PRINTING > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp >index 9c6bbdd7c3ed37688bd95a92276b7de6764dbc09..5104872399c0c84099177512cc3d4cc72c59bc3b 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp >@@ -122,7 +122,7 @@ static void startTestServer() > > static void checkAtspiAccessible(AtspiAccessible* accessible, const char* targetName, AtspiRole targetRole) > { >- g_assert(ATSPI_IS_ACCESSIBLE(accessible)); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(accessible)); > > GUniquePtr<char> name(atspi_accessible_get_name(accessible, 0)); > g_assert_cmpstr(targetName, ==, name.get()); >@@ -150,58 +150,58 @@ static void testAtspiBasicHierarchy(WebViewTest* test, gconstpointer) > { > // The test server's accessibility object (UI Process). > GRefPtr<AtspiAccessible> testServerApp = findTestServerApplication(); >- g_assert(ATSPI_IS_ACCESSIBLE(testServerApp.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(testServerApp.get())); > checkAtspiAccessible(testServerApp.get(), "AccessibilityTestServer", ATSPI_ROLE_APPLICATION); > > // The main window's accessibility object (UI Process). > GRefPtr<AtspiAccessible> currentParent = testServerApp; > GRefPtr<AtspiAccessible> currentChild = adoptGRef(atspi_accessible_get_child_at_index(currentParent.get(), 0, 0)); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_FRAME); > > // The WebView's accessibility object (UI Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_FILLER); > > // The WebPage's accessibility object (Web Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_FILLER); > > // HTML root element's accessible element (Web Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > > // HTML body's accessible element (Web Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_DOCUMENT_WEB); > > // HTML H1's accessible element (Web Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "This is a test", ATSPI_ROLE_HEADING); > > // HTML first paragraph's accessible element (Web Process). > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 1, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_PARAGRAPH); > > // HTML second paragraph's accessible element (Web Process). > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 2, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "", ATSPI_ROLE_PARAGRAPH); > > // HTML link's accessible element (Web Process). > currentParent = currentChild; > currentChild = atspi_accessible_get_child_at_index(currentParent.get(), 0, 0); >- g_assert(ATSPI_IS_ACCESSIBLE(currentChild.get())); >+ g_assert_true(ATSPI_IS_ACCESSIBLE(currentChild.get())); > checkAtspiAccessible(currentChild.get(), "a link", ATSPI_ROLE_LINK); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitVersion.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitVersion.cpp >index e747ff962200dbd244993f521d2d163c12ad23c3..aa38a150840c55cd3b565d0aac15a9b142435dbf 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitVersion.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitVersion.cpp >@@ -33,10 +33,10 @@ static void testWebKitVersion(Test*, gconstpointer) > > static void testWebKitCheckVersion(Test*, gconstpointer) > { >- g_assert(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); >- g_assert(!WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION + 1, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); >- g_assert(!WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION + 1, WEBKIT_MICRO_VERSION)); >- g_assert(!WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION + 1)); >+ g_assert_true(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); >+ g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION + 1, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION)); >+ g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION + 1, WEBKIT_MICRO_VERSION)); >+ g_assert_false(WEBKIT_CHECK_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION, WEBKIT_MICRO_VERSION + 1)); > } > > void beforeAll() >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp >index 88711951df03b5506596bd328705454eef34cdee..0d09f02c2e7883f9adb803e717fdcac6d5bc4bf1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp >@@ -56,7 +56,7 @@ public: > { > GUniqueOutPtr<GError> error; > test->m_canExecuteEditingCommand = webkit_web_view_can_execute_editing_command_finish(test->m_webView, result, &error.outPtr()); >- g_assert(!error.get()); >+ g_assert_no_error(error.get()); > g_main_loop_quit(test->m_mainLoop); > } > >@@ -67,17 +67,17 @@ public: > g_main_loop_run(m_mainLoop); > > if (!strcmp(command, WEBKIT_EDITING_COMMAND_CUT)) >- g_assert(m_canExecuteEditingCommand == webkit_editor_state_is_cut_available(editorState())); >+ g_assert_cmpint(m_canExecuteEditingCommand, ==, webkit_editor_state_is_cut_available(editorState())); > else if (!strcmp(command, WEBKIT_EDITING_COMMAND_COPY)) >- g_assert(m_canExecuteEditingCommand == webkit_editor_state_is_copy_available(editorState())); >+ g_assert_cmpint(m_canExecuteEditingCommand, ==, webkit_editor_state_is_copy_available(editorState())); > else if (!strcmp(command, WEBKIT_EDITING_COMMAND_PASTE)) >- g_assert(m_canExecuteEditingCommand == webkit_editor_state_is_paste_available(editorState())); >+ g_assert_cmpint(m_canExecuteEditingCommand, ==, webkit_editor_state_is_paste_available(editorState())); > // FIXME: Figure out how to add tests for undo and redo. It will probably require using user > // scripts to message the UI process when the content has been altered. > else if (!strcmp(command, WEBKIT_EDITING_COMMAND_UNDO)) >- g_assert(m_canExecuteEditingCommand == webkit_editor_state_is_undo_available(editorState())); >+ g_assert_cmpint(m_canExecuteEditingCommand, ==, webkit_editor_state_is_undo_available(editorState())); > else if (!strcmp(command, WEBKIT_EDITING_COMMAND_REDO)) >- g_assert(m_canExecuteEditingCommand == webkit_editor_state_is_redo_available(editorState())); >+ g_assert_cmpint(m_canExecuteEditingCommand, ==, webkit_editor_state_is_redo_available(editorState())); > > return m_canExecuteEditingCommand; > } >@@ -105,8 +105,8 @@ public: > > gchar* cutSelection() > { >- g_assert(canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_true(canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_true(canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > > webkit_web_view_execute_editing_command(m_webView, WEBKIT_EDITING_COMMAND_CUT); > // There's no way to know when the selection has been cut to >@@ -162,20 +162,20 @@ static const char* selectedSpanHTMLFormat = > static void testWebViewEditorCutCopyPasteNonEditable(EditorTest* test, gconstpointer) > { > // Nothing loaded yet. >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > > GUniquePtr<char> selectedSpanHTML(g_strdup_printf(selectedSpanHTMLFormat, "false")); > test->loadHtml(selectedSpanHTML.get(), nullptr); > test->waitUntilLoadFinished(); > test->flushEditorState(); > >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); > // It's not possible to cut and paste when content is not editable > // even if there's a selection. >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > > test->copyClipboard(); > GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard)); >@@ -185,13 +185,13 @@ static void testWebViewEditorCutCopyPasteNonEditable(EditorTest* test, gconstpoi > static void testWebViewEditorCutCopyPasteEditable(EditorTest* test, gconstpointer) > { > // Nothing loaded yet. >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > test->setEditable(true); >- g_assert(test->isEditable()); >+ g_assert_true(test->isEditable()); > > GUniquePtr<char> selectedSpanHTML(g_strdup_printf(selectedSpanHTMLFormat, "false")); > test->loadHtml(selectedSpanHTML.get(), nullptr); >@@ -199,9 +199,9 @@ static void testWebViewEditorCutCopyPasteEditable(EditorTest* test, gconstpointe > test->flushEditorState(); > > // There's a selection. >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_COPY)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > > test->copyClipboard(); > GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard)); >@@ -210,14 +210,14 @@ static void testWebViewEditorCutCopyPasteEditable(EditorTest* test, gconstpointe > > static void testWebViewEditorSelectAllNonEditable(EditorTest* test, gconstpointer) > { >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); > > GUniquePtr<char> selectedSpanHTML(g_strdup_printf(selectedSpanHTMLFormat, "false")); > test->loadHtml(selectedSpanHTML.get(), nullptr); > test->waitUntilLoadFinished(); > test->flushEditorState(); > >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); > > test->copyClipboard(); > GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard)); >@@ -235,18 +235,18 @@ static void testWebViewEditorSelectAllNonEditable(EditorTest* test, gconstpointe > > static void testWebViewEditorSelectAllEditable(EditorTest* test, gconstpointer) > { >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); > >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > test->setEditable(true); >- g_assert(test->isEditable()); >+ g_assert_true(test->isEditable()); > > GUniquePtr<char> selectedSpanHTML(g_strdup_printf(selectedSpanHTMLFormat, "false")); > test->loadHtml(selectedSpanHTML.get(), nullptr); > test->waitUntilLoadFinished(); > test->flushEditorState(); > >- g_assert(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); >+ g_assert_true(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_SELECT_ALL)); > > test->copyClipboard(); > GUniquePtr<char> clipboardText(gtk_clipboard_wait_for_text(test->m_clipboard)); >@@ -265,16 +265,16 @@ static void testWebViewEditorSelectAllEditable(EditorTest* test, gconstpointer) > static void loadContentsAndTryToCutSelection(EditorTest* test, bool contentEditable) > { > // View is not editable by default. >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > > GUniquePtr<char> selectedSpanHTML(g_strdup_printf(selectedSpanHTMLFormat, contentEditable ? "true" : "false")); > test->loadHtml(selectedSpanHTML.get(), nullptr); > test->waitUntilLoadFinished(); > test->flushEditorState(); > >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > test->setEditable(true); >- g_assert(test->isEditable()); >+ g_assert_true(test->isEditable()); > > test->flushEditorState(); > >@@ -284,7 +284,7 @@ static void loadContentsAndTryToCutSelection(EditorTest* test, bool contentEdita > > // Reset the editable for next test. > test->setEditable(false); >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > } > > static void testWebViewEditorNonEditable(EditorTest* test) >@@ -294,15 +294,15 @@ static void testWebViewEditorNonEditable(EditorTest* test) > test->waitUntilLoadFinished(); > test->flushEditorState(); > >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > test->setEditable(true); >- g_assert(test->isEditable()); >+ g_assert_true(test->isEditable()); > test->setEditable(false); >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > > // Check if view is indeed non-editable. >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >- g_assert(!test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_CUT)); >+ g_assert_false(test->canExecuteEditingCommand(WEBKIT_EDITING_COMMAND_PASTE)); > } > > static void testWebViewEditorEditable(EditorTest* test, gconstpointer) >@@ -311,13 +311,13 @@ static void testWebViewEditorEditable(EditorTest* test, gconstpointer) > > // Reset the editable for next test. > test->setEditable(false); >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > > loadContentsAndTryToCutSelection(test, true); > > // Reset the editable for next test. > test->setEditable(false); >- g_assert(!test->isEditable()); >+ g_assert_false(test->isEditable()); > > loadContentsAndTryToCutSelection(test, false); > } >@@ -342,46 +342,46 @@ static void testWebViewEditorEditorStateTypingAttributes(EditorTest* test, gcons > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > // Selections. > webkit_web_view_execute_editing_command(test->m_webView, "MoveToBeginningOfDocument"); >@@ -393,46 +393,46 @@ static void testWebViewEditorEditorStateTypingAttributes(EditorTest* test, gcons > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForwardAndModifySelection"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForwardAndModifySelection"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForwardAndModifySelection"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForwardAndModifySelection"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveForward"); > webkit_web_view_execute_editing_command(test->m_webView, "MoveWordForwardAndModifySelection"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >- g_assert(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE)); >- g_assert(!(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH)); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_BOLD); >+ g_assert_true(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_ITALIC); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_UNDERLINE); >+ g_assert_false(typingAttributes & WEBKIT_EDITOR_TYPING_ATTRIBUTE_STRIKETHROUGH); > > webkit_web_view_execute_editing_command(test->m_webView, "SelectAll"); > typingAttributes = test->waitUntilTypingAttributesChanged(); >@@ -451,8 +451,8 @@ static void testWebViewEditorInsertImage(EditorTest* test, gconstpointer) > webkit_web_view_execute_editing_command_with_argument(test->m_webView, WEBKIT_EDITING_COMMAND_INSERT_IMAGE, imageURI.get()); > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByTagName('IMG')[0].src", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(resultString.get(), ==, imageURI.get()); > } >@@ -468,13 +468,13 @@ static void testWebViewEditorCreateLink(EditorTest* test, gconstpointer) > webkit_web_view_execute_editing_command_with_argument(test->m_webView, WEBKIT_EDITING_COMMAND_CREATE_LINK, webkitGTKURL); > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByTagName('A')[0].href;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > GUniquePtr<char> resultString(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(resultString.get(), ==, webkitGTKURL); > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByTagName('A')[0].innerText;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > resultString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(resultString.get(), ==, "webkitgtk.org"); > >@@ -482,13 +482,13 @@ static void testWebViewEditorCreateLink(EditorTest* test, gconstpointer) > webkit_web_view_execute_editing_command(test->m_webView, "MoveToEndOfLine"); > webkit_web_view_execute_editing_command_with_argument(test->m_webView, WEBKIT_EDITING_COMMAND_CREATE_LINK, webkitGTKURL); > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByTagName('A')[1].href;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > resultString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(resultString.get(), ==, webkitGTKURL); > javascriptResult = test->runJavaScriptAndWaitUntilFinished("document.getElementsByTagName('A')[1].innerText;", &error.outPtr()); >- g_assert(javascriptResult); >- g_assert(!error); >+ g_assert_nonnull(javascriptResult); >+ g_assert_no_error(error.get()); > resultString.reset(WebViewTest::javascriptResultToCString(javascriptResult)); > g_assert_cmpstr(resultString.get(), ==, webkitGTKURL); > } >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp >index e6a3482d3e91d75b9ed87d21f2a8c75c39663901..2dddeca362e9b2282476f995d326771b5a88520e 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/LoadTrackingTest.cpp >@@ -24,38 +24,38 @@ static void loadChangedCallback(WebKitWebView* webView, WebKitLoadEvent loadEven > { > switch (loadEvent) { > case WEBKIT_LOAD_STARTED: >- g_assert(webkit_web_view_is_loading(webView)); >+ g_assert_true(webkit_web_view_is_loading(webView)); > g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView)); > test->provisionalLoadStarted(); > break; > case WEBKIT_LOAD_REDIRECTED: >- g_assert(webkit_web_view_is_loading(webView)); >+ g_assert_true(webkit_web_view_is_loading(webView)); > test->m_activeURI = webkit_web_view_get_uri(webView); > if (!test->m_redirectURI.isNull()) > g_assert_cmpstr(test->m_redirectURI.data(), ==, test->m_activeURI.data()); > test->provisionalLoadReceivedServerRedirect(); > break; > case WEBKIT_LOAD_COMMITTED: { >- g_assert(webkit_web_view_is_loading(webView)); >+ g_assert_true(webkit_web_view_is_loading(webView)); > test->m_activeURI = webkit_web_view_get_uri(webView); > > // Check that on committed we always have a main resource with a response. > WebKitWebResource* resource = webkit_web_view_get_main_resource(webView); >- g_assert(resource); >- g_assert(webkit_web_resource_get_response(resource)); >+ g_assert_nonnull(resource); >+ g_assert_nonnull(webkit_web_resource_get_response(resource)); > > test->loadCommitted(); > break; > } > case WEBKIT_LOAD_FINISHED: > if (!test->m_loadFailed) { >- g_assert(!webkit_web_view_is_loading(webView)); >+ g_assert_false(webkit_web_view_is_loading(webView)); > g_assert_cmpstr(test->m_activeURI.data(), ==, webkit_web_view_get_uri(webView)); > } else if (!g_error_matches(test->m_error.get(), WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) { > // When a new load is started before the previous one has finished, we receive the load-finished signal > // of the ongoing load while we already have a provisional URL for the new load. This is the only case > // where isloading is true when the load has finished. >- g_assert(!webkit_web_view_is_loading(webView)); >+ g_assert_false(webkit_web_view_is_loading(webView)); > } > test->loadFinished(); > break; >@@ -68,14 +68,14 @@ static void loadFailedCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent > { > test->m_loadFailed = true; > >- g_assert(error); >+ g_assert_nonnull(error); > test->m_error.reset(g_error_copy(error)); > > if (!g_error_matches(error, WEBKIT_NETWORK_ERROR, WEBKIT_NETWORK_ERROR_CANCELLED)) { > // When a new load is started before the previous one has finished, we receive the load-failed signal > // of the ongoing load while we already have a provisional URL for the new load. This is the only case > // where is-loading is true when the load has failed. >- g_assert(!webkit_web_view_is_loading(webView)); >+ g_assert_false(webkit_web_view_is_loading(webView)); > } > > switch (loadEvent) { >@@ -95,10 +95,10 @@ static void loadFailedCallback(WebKitWebView* webView, WebKitLoadEvent loadEvent > static gboolean loadFailedWithTLSErrorsCallback(WebKitWebView* webView, const char* failingURI, GTlsCertificate* certificate, GTlsCertificateFlags tlsErrors, LoadTrackingTest* test) > { > test->m_loadFailed = true; >- g_assert(!webkit_web_view_is_loading(webView)); >+ g_assert_false(webkit_web_view_is_loading(webView)); > g_assert_cmpstr(test->m_activeURI.data(), ==, failingURI); >- g_assert(G_IS_TLS_CERTIFICATE(certificate)); >- g_assert(tlsErrors); >+ g_assert_true(G_IS_TLS_CERTIFICATE(certificate)); >+ g_assert_cmpuint(tlsErrors, !=, 0); > return test->loadFailedWithTLSErrors(failingURI, certificate, tlsErrors); > } > >@@ -116,7 +116,7 @@ LoadTrackingTest::LoadTrackingTest() > g_signal_connect(m_webView, "load-failed-with-tls-errors", G_CALLBACK(loadFailedWithTLSErrorsCallback), this); > g_signal_connect(m_webView, "notify::estimated-load-progress", G_CALLBACK(estimatedProgressChangedCallback), this); > >- g_assert(!webkit_web_view_get_uri(m_webView)); >+ g_assert_null(webkit_web_view_get_uri(m_webView)); > } > > LoadTrackingTest::~LoadTrackingTest() >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.cpp >index c7699d44c24cac3c7485094d8ea99fc2d0ffcc2d..a155a5100a6bbaedf0ae1b52769a738718a0f5cf 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.cpp >@@ -42,7 +42,7 @@ static void registerGResource(void) > { > GUniquePtr<char> resourcesPath(g_build_filename(WEBKIT_TEST_RESOURCES_DIR, "webkitglib-tests-resources.gresource", nullptr)); > GResource* resource = g_resource_load(resourcesPath.get(), nullptr); >- g_assert(resource); >+ g_assert_nonnull(resource); > > g_resources_register(resource); > g_resource_unref(resource); >@@ -51,7 +51,7 @@ static void registerGResource(void) > static void removeNonEmptyDirectory(const char* directoryPath) > { > GDir* directory = g_dir_open(directoryPath, 0, 0); >- g_assert(directory); >+ g_assert_nonnull(directory); > const char* fileName; > while ((fileName = g_dir_read_name(directory))) { > GUniquePtr<char> filePath(g_build_filename(directoryPath, fileName, nullptr)); >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h b/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h >index 313f21771bcfb32f491dfbe58adf7925c0b2273f..8b832866e86d1fa7b02c522a297fedd6f493a206 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h >@@ -19,6 +19,8 @@ > > #pragma once > >+#include "TestUtils.h" >+ > #include <cairo.h> > #include <glib-object.h> > #include <wtf/HashSet.h> >@@ -67,27 +69,15 @@ > g_test_add(testPath.get(), ClassName, 0, ClassName::setUp, testFunc, ClassName::tearDown); \ > } > >-#define ASSERT_CMP_CSTRING(s1, cmp, s2) \ >- do { \ >- CString __s1 = (s1); \ >- CString __s2 = (s2); \ >- if (g_strcmp0(__s1.data(), __s2.data()) cmp 0) ; \ >- else { \ >- g_assertion_message_cmpstr(G_LOG_DOMAIN, __FILE__, __LINE__, \ >- G_STRFUNC, #s1 " " #cmp " " #s2, __s1.data(), #cmp, __s2.data()); \ >- } \ >- } while (0) >- >- > class Test { > public: > MAKE_GLIB_TEST_FIXTURE(Test); > > static GRefPtr<WebKitWebView> adoptView(gpointer view) > { >- g_assert(WEBKIT_IS_WEB_VIEW(view)); >+ g_assert_true(WEBKIT_IS_WEB_VIEW(view)); > #if PLATFORM(GTK) >- g_assert(g_object_is_floating(view)); >+ g_assert_true(g_object_is_floating(view)); > return GRefPtr<WebKitWebView>(WEBKIT_WEB_VIEW(view)); > #elif PLATFORM(WPE) > return adoptGRef(WEBKIT_WEB_VIEW(view)); >@@ -130,7 +120,7 @@ public: > g_print(" %s(%p)", g_type_name_from_instance(reinterpret_cast<GTypeInstance*>(*it)), *it); > g_print("\n"); > >- g_assert(m_watchedObjects.isEmpty()); >+ g_assert_true(m_watchedObjects.isEmpty()); > } > > virtual void initializeWebExtensions() >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/TestUtils.h b/Tools/TestWebKitAPI/glib/WebKitGLib/TestUtils.h >new file mode 100644 >index 0000000000000000000000000000000000000000..2af384fbc71904833ad5687397d38068d27ebd0f >--- /dev/null >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/TestUtils.h >@@ -0,0 +1,71 @@ >+/* >+ * Copyright (C) 2011, 2018 Igalia S.L. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#pragma once >+ >+#include <glib.h> >+#include <wtf/Compiler.h> >+ >+#define ASSERT_CMP_CSTRING(s1, cmp, s2) \ >+ do { \ >+ CString __s1 = (s1); \ >+ CString __s2 = (s2); \ >+ if (g_strcmp0(__s1.data(), __s2.data()) cmp 0) ; \ >+ else { \ >+ g_assertion_message_cmpstr(G_LOG_DOMAIN, __FILE__, __LINE__, \ >+ G_STRFUNC, #s1 " " #cmp " " #s2, __s1.data(), #cmp, __s2.data()); \ >+ } \ >+ } while (0) >+ >+// Redefined with stronger casts, to make this useable in C++. >+#undef g_assert_cmphex >+#define g_assert_cmphex(n1, cmp, n2) \ >+ do { \ >+ auto __n1 = reinterpret_cast<intptr_t>(n1); \ >+ auto __n2 = reinterpret_cast<intptr_t>(n2); \ >+ if (__n1 cmp __n2) ; \ >+ else { \ >+ g_assertion_message_cmpnum(G_LOG_DOMAIN, __FILE__, __LINE__, \ >+ G_STRFUNC, #n1 " " #cmp " " #n2, (long double)(__n1), #cmp, (long double)(__n2), 'x'); \ >+ } \ >+ } while (0) >+ >+// Redefined for nullptr type checking. >+#undef g_assert_null >+#define g_assert_null(expr) \ >+ do { \ >+ if G_LIKELY((expr) == nullptr) ; \ >+ else { \ >+ g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, \ >+ G_STRFUNC, "'" #expr "' should not be NULL"); \ >+ } \ >+ } while (0) >+ >+// Redefined to silence -Wpointer-arith, and for nullptr type checking. >+#undef g_assert_nonnull >+#define g_assert_nonnull(expr) \ >+ do { \ >+ IGNORE_WARNINGS_BEGIN("pointer-arith") \ >+ if G_LIKELY((expr) != nullptr) ; \ >+ else { \ >+ g_assertion_message(G_LOG_DOMAIN, __FILE__, __LINE__, \ >+ G_STRFUNC, "'" #expr "' should not be NULL"); \ >+ } \ >+ IGNORE_WARNINGS_END \ >+ } while (0) >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp >index 84ddc5dd89898934cb0a043dd27278e24974214b..ba6476c8da15bb4b3b846640aa397a567d64525b 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestBus.cpp >@@ -48,11 +48,11 @@ GDBusConnection* WebKitTestBus::getOrCreateConnection() > if (m_connection) > return m_connection.get(); > >- g_assert(!m_address.isNull()); >+ g_assert_false(m_address.isNull()); > m_connection = adoptGRef(g_dbus_connection_new_for_address_sync(m_address.data(), > static_cast<GDBusConnectionFlags>(G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION), > nullptr, nullptr, nullptr)); >- g_assert(m_connection.get()); >+ g_assert_nonnull(m_connection.get()); > return m_connection.get(); > } > >@@ -76,6 +76,6 @@ GDBusProxy* WebKitTestBus::createProxy(const char* serviceName, const char* obje > interfaceName, > nullptr, // GCancellable > nullptr); >- g_assert(proxy); >+ g_assert_nonnull(proxy); > return proxy; > } >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp >index fd1623c9f6c7e97afda7db8e78e3080ec5887a8b..782fe393c8f584ceb5a0277df56e4b358c1e416e 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/WebKitTestServer.cpp >@@ -101,8 +101,8 @@ void WebKitTestServer::removeWebSocketHandler() > > CString WebKitTestServer::getWebSocketURIForPath(const char* path) const > { >- g_assert(m_baseWebSocketURI); >- g_assert(path && *path == '/'); >+ g_assert_nonnull(m_baseWebSocketURI); >+ g_assert_true(path && *path == '/'); > SoupURI* uri = soup_uri_new_with_base(m_baseWebSocketURI, path + 1); // Ignore the leading slash. > GUniquePtr<gchar> uriString(soup_uri_to_string(uri, FALSE)); > soup_uri_free(uri); >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp >index e420c3e2b4734a9291687fc773980eeca5e61d54..efd9fbf4544956e272b9c367f187a0e8de376e7a 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp >@@ -47,7 +47,7 @@ WebViewTest::~WebViewTest() > > void WebViewTest::initializeWebView() > { >- g_assert(!m_webView); >+ g_assert_null(m_webView); > > m_webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, > #if PLATFORM(WPE) >@@ -76,7 +76,7 @@ void WebViewTest::loadURI(const char* uri) > { > m_activeURI = uri; > webkit_web_view_load_uri(m_webView, uri); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -87,7 +87,7 @@ void WebViewTest::loadHtml(const char* html, const char* baseURI) > else > m_activeURI = baseURI; > webkit_web_view_load_html(m_webView, html, baseURI); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -95,7 +95,7 @@ void WebViewTest::loadPlainText(const char* plainText) > { > m_activeURI = "about:blank"; > webkit_web_view_load_plain_text(m_webView, plainText); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -106,7 +106,7 @@ void WebViewTest::loadBytes(GBytes* bytes, const char* mimeType, const char* enc > else > m_activeURI = baseURI; > webkit_web_view_load_bytes(m_webView, bytes, mimeType, encoding, baseURI); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -114,7 +114,7 @@ void WebViewTest::loadRequest(WebKitURIRequest* request) > { > m_activeURI = webkit_uri_request_get_uri(request); > webkit_web_view_load_request(m_webView, request); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -122,7 +122,7 @@ void WebViewTest::loadAlternateHTML(const char* html, const char* contentURI, co > { > m_activeURI = contentURI; > webkit_web_view_load_alternate_html(m_webView, html, contentURI, baseURI); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -138,7 +138,7 @@ void WebViewTest::goBack() > // Call go_back even when can_go_back returns FALSE to check nothing happens. > webkit_web_view_go_back(m_webView); > if (canGoBack) { >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > } >@@ -155,7 +155,7 @@ void WebViewTest::goForward() > // Call go_forward even when can_go_forward returns FALSE to check nothing happens. > webkit_web_view_go_forward(m_webView); > if (canGoForward) { >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > } >@@ -164,7 +164,7 @@ void WebViewTest::goToBackForwardListItem(WebKitBackForwardListItem* item) > { > m_activeURI = webkit_back_forward_list_item_get_original_uri(item); > webkit_web_view_go_to_back_forward_list_item(m_webView, item); >- g_assert(webkit_web_view_is_loading(m_webView)); >+ g_assert_true(webkit_web_view_is_loading(m_webView)); > g_assert_cmpstr(webkit_web_view_get_uri(m_webView), ==, m_activeURI.data()); > } > >@@ -238,7 +238,7 @@ static void resourceGetDataCallback(GObject* object, GAsyncResult* result, gpoin > size_t dataSize; > GUniqueOutPtr<GError> error; > unsigned char* data = webkit_web_resource_get_data_finish(WEBKIT_WEB_RESOURCE(object), result, &dataSize, &error.outPtr()); >- g_assert(data); >+ g_assert_nonnull(data); > > WebViewTest* test = static_cast<WebViewTest*>(userData); > test->m_resourceData.reset(reinterpret_cast<char*>(data)); >@@ -251,7 +251,7 @@ const char* WebViewTest::mainResourceData(size_t& mainResourceDataSize) > m_resourceDataSize = 0; > m_resourceData.reset(); > WebKitWebResource* resource = webkit_web_view_get_main_resource(m_webView); >- g_assert(resource); >+ g_assert_nonnull(resource); > > webkit_web_resource_get_data(resource, 0, resourceGetDataCallback, this); > g_main_loop_run(m_mainLoop); >@@ -317,38 +317,38 @@ WebKitJavascriptResult* WebViewTest::runJavaScriptInWorldAndWaitUntilFinished(co > char* WebViewTest::javascriptResultToCString(WebKitJavascriptResult* javascriptResult) > { > auto* value = webkit_javascript_result_get_js_value(javascriptResult); >- g_assert(JSC_IS_VALUE(value)); >- g_assert(jsc_value_is_string(value)); >+ g_assert_true(JSC_IS_VALUE(value)); >+ g_assert_true(jsc_value_is_string(value)); > return jsc_value_to_string(value); > } > > double WebViewTest::javascriptResultToNumber(WebKitJavascriptResult* javascriptResult) > { > auto* value = webkit_javascript_result_get_js_value(javascriptResult); >- g_assert(JSC_IS_VALUE(value)); >- g_assert(jsc_value_is_number(value)); >+ g_assert_true(JSC_IS_VALUE(value)); >+ g_assert_true(jsc_value_is_number(value)); > return jsc_value_to_double(value); > } > > bool WebViewTest::javascriptResultToBoolean(WebKitJavascriptResult* javascriptResult) > { > auto* value = webkit_javascript_result_get_js_value(javascriptResult); >- g_assert(JSC_IS_VALUE(value)); >- g_assert(jsc_value_is_boolean(value)); >+ g_assert_true(JSC_IS_VALUE(value)); >+ g_assert_true(jsc_value_is_boolean(value)); > return jsc_value_to_boolean(value); > } > > bool WebViewTest::javascriptResultIsNull(WebKitJavascriptResult* javascriptResult) > { > auto* value = webkit_javascript_result_get_js_value(javascriptResult); >- g_assert(JSC_IS_VALUE(value)); >+ g_assert_true(JSC_IS_VALUE(value)); > return jsc_value_is_null(value); > } > > bool WebViewTest::javascriptResultIsUndefined(WebKitJavascriptResult* javascriptResult) > { > auto* value = webkit_javascript_result_get_js_value(javascriptResult); >- g_assert(JSC_IS_VALUE(value)); >+ g_assert_true(JSC_IS_VALUE(value)); > return jsc_value_is_undefined(value); > } > >@@ -357,7 +357,7 @@ static void onSnapshotReady(WebKitWebView* web_view, GAsyncResult* res, WebViewT > { > GUniqueOutPtr<GError> error; > test->m_surface = webkit_web_view_get_snapshot_finish(web_view, res, &error.outPtr()); >- g_assert(!test->m_surface || !error.get()); >+ g_assert_true(!test->m_surface || !error.get()); > if (error) > g_assert_error(error.get(), WEBKIT_SNAPSHOT_ERROR, WEBKIT_SNAPSHOT_ERROR_FAILED_TO_CREATE); > test->quitMainLoop(); >@@ -388,7 +388,7 @@ bool WebViewTest::runWebProcessTest(const char* suiteName, const char* testName, > GUniquePtr<char> script(g_strdup_printf("WebProcessTestRunner.runTest('%s/%s');", suiteName, testName)); > GUniqueOutPtr<GError> error; > WebKitJavascriptResult* javascriptResult = runJavaScriptAndWaitUntilFinished(script.get(), &error.outPtr()); >- g_assert(!error); >+ g_assert_no_error(error.get()); > loadURI("about:blank"); > waitUntilLoadFinished(); > return javascriptResultToBoolean(javascriptResult); >diff --git a/Tools/TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp b/Tools/TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp >index a1341a6848df1eca278ca8d642d7d6a87a48c3a4..bba84b02d966da862ba5c47e043e81e446acb9db 100644 >--- a/Tools/TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp >+++ b/Tools/TestWebKitAPI/glib/WebKitGLib/gtk/WebViewTestGtk.cpp >@@ -32,8 +32,8 @@ void WebViewTest::platformDestroy() > > void WebViewTest::platformInitializeWebView() > { >- g_assert(WEBKIT_WEB_VIEW(m_webView)); >- g_assert(g_object_is_floating(m_webView)); >+ g_assert_true(WEBKIT_WEB_VIEW(m_webView)); >+ g_assert_true(g_object_is_floating(m_webView)); > g_object_ref_sink(m_webView); > } > >@@ -70,7 +70,7 @@ static gboolean parentWindowMapped(GtkWidget* widget, GdkEvent*, WebViewTest* te > > void WebViewTest::showInWindow(GtkWindowType windowType) > { >- g_assert(!m_parentWindow); >+ g_assert_null(m_parentWindow); > m_parentWindow = gtk_window_new(windowType); > gtk_container_add(GTK_CONTAINER(m_parentWindow), GTK_WIDGET(m_webView)); > gtk_widget_show(GTK_WIDGET(m_webView)); >@@ -79,7 +79,7 @@ void WebViewTest::showInWindow(GtkWindowType windowType) > > void WebViewTest::showInWindowAndWaitUntilMapped(GtkWindowType windowType, int width, int height) > { >- g_assert(!m_parentWindow); >+ g_assert_null(m_parentWindow); > m_parentWindow = gtk_window_new(windowType); > if (width && height) > gtk_window_resize(GTK_WINDOW(m_parentWindow), width, height); >@@ -93,9 +93,9 @@ void WebViewTest::showInWindowAndWaitUntilMapped(GtkWindowType windowType, int w > > void WebViewTest::mouseMoveTo(int x, int y, unsigned mouseModifiers) > { >- g_assert(m_parentWindow); >+ g_assert_nonnull(m_parentWindow); > GtkWidget* viewWidget = GTK_WIDGET(m_webView); >- g_assert(gtk_widget_get_realized(viewWidget)); >+ g_assert_true(gtk_widget_get_realized(viewWidget)); > > GUniquePtr<GdkEvent> event(gdk_event_new(GDK_MOTION_NOTIFY)); > event->motion.x = x; >@@ -124,7 +124,7 @@ void WebViewTest::clickMouseButton(int x, int y, unsigned button, unsigned mouse > void WebViewTest::emitPopupMenuSignal() > { > GtkWidget* viewWidget = GTK_WIDGET(m_webView); >- g_assert(gtk_widget_get_realized(viewWidget)); >+ g_assert_true(gtk_widget_get_realized(viewWidget)); > > gboolean handled; > g_signal_emit_by_name(viewWidget, "popup-menu", &handled); >@@ -132,9 +132,9 @@ void WebViewTest::emitPopupMenuSignal() > > void WebViewTest::keyStroke(unsigned keyVal, unsigned keyModifiers) > { >- g_assert(m_parentWindow); >+ g_assert_nonnull(m_parentWindow); > GtkWidget* viewWidget = GTK_WIDGET(m_webView); >- g_assert(gtk_widget_get_realized(viewWidget)); >+ g_assert_true(gtk_widget_get_realized(viewWidget)); > > GUniquePtr<GdkEvent> event(gdk_event_new(GDK_KEY_PRESS)); > event->key.keyval = keyVal; >@@ -158,9 +158,9 @@ void WebViewTest::keyStroke(unsigned keyVal, unsigned keyModifiers) > > void WebViewTest::doMouseButtonEvent(GdkEventType eventType, int x, int y, unsigned button, unsigned mouseModifiers) > { >- g_assert(m_parentWindow); >+ g_assert_nonnull(m_parentWindow); > GtkWidget* viewWidget = GTK_WIDGET(m_webView); >- g_assert(gtk_widget_get_realized(viewWidget)); >+ g_assert_true(gtk_widget_get_realized(viewWidget)); > > GUniquePtr<GdkEvent> event(gdk_event_new(eventType)); > event->button.window = gtk_widget_get_window(viewWidget);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192841
:
357651
|
357744
|
358207