Bug 38316 - [Qt] REGRESSION(r57638): tst_qwebframe::objectDeleted() fails
Summary: [Qt] REGRESSION(r57638): tst_qwebframe::objectDeleted() fails
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Blocker
Assignee: Simon Hausmann
Keywords: Qt
Depends on:
Blocks: 35784
  Show dependency treegraph
Reported: 2010-04-29 03:11 PDT by Simon Hausmann
Modified: 2010-04-29 03:21 PDT (History)
1 user (show)

See Also:

Patch (1.54 KB, patch)
2010-04-29 03:14 PDT, Simon Hausmann
vestbo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Hausmann 2010-04-29 03:11:49 PDT
After r57638 the objectDeleted() test fails:

FAIL!  : tst_QWebFrame::objectDeleted() Compared values are not the same
   Actual (type): undefined
   Expected (sError): error
   Loc: [/home/shausman/src/webkit/trunk/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp(2056)]

The test creates a QObject, accesses its properties, deletes it and tries to access it again. Accessing the properties of a deleted object should give an exception, just like in QtScript.

The following hunk from r57638 caused a slight change in behaviour, triggering the regression:

@@ -171,6 +171,8 @@ QtInstance* QtInstance::getInstance(JSObject* object)

 Class* QtInstance::getClass() const
+    if (!m_object)
+        return 0;
     if (!m_class)
         m_class = QtClass::classForObject(m_object);
     return m_class;

After that change even if m_class existed, null is returned.

QtClass itself is protected to handle null objects, so a safe solution would be to return null only if we have never created the class wrapper in the first place.
Comment 1 Simon Hausmann 2010-04-29 03:14:15 PDT
Created attachment 54687 [details]
Comment 2 Simon Hausmann 2010-04-29 03:20:58 PDT
Committed r58493: <http://trac.webkit.org/changeset/58493>
Comment 3 Simon Hausmann 2010-04-29 03:21:38 PDT
Revision r58493 cherry-picked into qtwebkit-2.0 with commit 1a40220a82197023c1b1ac6eff027be6dd3168d3