<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174105] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174105">174105</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-09-30 06:38:03 -0700 (Tue, 30 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/173929">r173929</a>): [GTK] TestInspector fails after <a href="http://trac.webkit.org/projects/webkit/changeset/173929">r173929</a>
https://bugs.webkit.org/show_bug.cgi?id=137247

Reviewed by Philippe Normand.

Source/WebKit2:

Add WebKitWebInspector:can-attach property to notify when the
inspector attach availability changes.

* UIProcess/API/C/gtk/WKInspectorClientGtk.h:
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkit_web_inspector_class_init): Add WebKitWebInspector:can-attach property.
(didChangeAttachAvailability): Emit notify::can-attach.
(webkitWebInspectorCreate): Add implementation for didChangeAttachAvailability.
(webkit_web_inspector_get_can_attach): Return whether the inspector can be attached.
* UIProcess/API/gtk/WebKitWebInspector.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add index of new symbols in 2.8.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
* UIProcess/gtk/WebInspectorClientGtk.cpp:
(WebKit::WebInspectorClientGtk::didChangeAttachAvailability):
* UIProcess/gtk/WebInspectorClientGtk.h:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Notify the client.

Tools:

Wait until can-attach property changes before trying to attach the
inspector after resizing the view.

* TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp:
(testInspectorDefault):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICgtkWKInspectorClientGtkh">trunk/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebInspectorcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebInspectorh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt">trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebInspectorClientGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebInspectorClientGtkh">trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestInspectorcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2014-09-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        REGRESSION(r173929): [GTK] TestInspector fails after r173929
+        https://bugs.webkit.org/show_bug.cgi?id=137247
+
+        Reviewed by Philippe Normand.
+
+        Add WebKitWebInspector:can-attach property to notify when the
+        inspector attach availability changes.
+
+        * UIProcess/API/C/gtk/WKInspectorClientGtk.h:
+        * UIProcess/API/gtk/WebKitWebInspector.cpp:
+        (webkit_web_inspector_class_init): Add WebKitWebInspector:can-attach property.
+        (didChangeAttachAvailability): Emit notify::can-attach.
+        (webkitWebInspectorCreate): Add implementation for didChangeAttachAvailability.
+        (webkit_web_inspector_get_can_attach): Return whether the inspector can be attached.
+        * UIProcess/API/gtk/WebKitWebInspector.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add index of new symbols in 2.8.
+        * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol.
+        * UIProcess/gtk/WebInspectorClientGtk.cpp:
+        (WebKit::WebInspectorClientGtk::didChangeAttachAvailability):
+        * UIProcess/gtk/WebInspectorClientGtk.h:
+        * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+        (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged): Notify the client.
+
+2014-09-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
</ins><span class="cx">         [GTK] The remote web inspector shows the HTML content as plain text
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=137250
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICgtkWKInspectorClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> typedef void (*WKInspectorClientGtkInspectedURLChangedCallback)(WKInspectorRef inspector, WKStringRef url, const void* clientInfo);
</span><span class="cx"> typedef void (*WKInspectorClientGtkDidChangeAttachedHeightCallback)(WKInspectorRef inspector, unsigned height, const void* clientInfo);
</span><span class="cx"> typedef void (*WKInspectorClientGtkDidChangeAttachedWidthCallback)(WKInspectorRef inspector, unsigned width, const void* clientInfo);
</span><ins>+typedef void (*WKInspectorClientGtkDidChangeAttachAvailabilityCallback)(WKInspectorRef inspector, bool available, const void* clientInfo);
</ins><span class="cx"> 
</span><span class="cx"> typedef struct WKInspectorClientGtkBase {
</span><span class="cx">     int                                                 version;
</span><span class="lines">@@ -54,6 +55,7 @@
</span><span class="cx">     WKInspectorClientGtkInspectorCallback               detach;
</span><span class="cx">     WKInspectorClientGtkDidChangeAttachedHeightCallback didChangeAttachedHeight;
</span><span class="cx">     WKInspectorClientGtkDidChangeAttachedWidthCallback  didChangeAttachedWidth;
</span><ins>+    WKInspectorClientGtkDidChangeAttachAvailabilityCallback didChangeAttachAvailability;
</ins><span class="cx"> } WKInspectorClientGtkV0;
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKInspectorSetInspectorClientGtk(WKInspectorRef inspectorRef, const WKInspectorClientGtkBase* client);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebInspectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -72,7 +72,8 @@
</span><span class="cx">     PROP_0,
</span><span class="cx"> 
</span><span class="cx">     PROP_INSPECTED_URI,
</span><del>-    PROP_ATTACHED_HEIGHT
</del><ins>+    PROP_ATTACHED_HEIGHT,
+    PROP_CAN_ATTACH
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitWebInspectorPrivate {
</span><span class="lines">@@ -84,6 +85,7 @@
</span><span class="cx">     RefPtr&lt;WebInspectorProxy&gt; webInspector;
</span><span class="cx">     CString inspectedURI;
</span><span class="cx">     unsigned attachedHeight;
</span><ins>+    bool canAttach;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WEBKIT_DEFINE_TYPE(WebKitWebInspector, webkit_web_inspector, G_TYPE_OBJECT)
</span><span class="lines">@@ -101,6 +103,9 @@
</span><span class="cx">     case PROP_ATTACHED_HEIGHT:
</span><span class="cx">         g_value_set_uint(value, webkit_web_inspector_get_attached_height(inspector));
</span><span class="cx">         break;
</span><ins>+    case PROP_CAN_ATTACH:
+        g_value_set_boolean(value, webkit_web_inspector_get_can_attach(inspector));
+        break;
</ins><span class="cx">     default:
</span><span class="cx">         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
</span><span class="cx">     }
</span><span class="lines">@@ -137,6 +142,24 @@
</span><span class="cx">                                                       WEBKIT_PARAM_READABLE));
</span><span class="cx"> 
</span><span class="cx">     /**
</span><ins>+     * WebKitWebInspector:can-attach:
+     *
+     * Whether the @inspector can be attached to the same window that contains
+     * the inspected view.
+     *
+     * Since: 2.8
+     */
+    g_object_class_install_property(
+        gObjectClass,
+        PROP_CAN_ATTACH,
+        g_param_spec_boolean(
+            &quot;can-attach&quot;,
+            _(&quot;Can Attach&quot;),
+            _(&quot;Whether the inspector can be attached to the same window that contains the inspected view&quot;),
+            FALSE,
+            WEBKIT_PARAM_READABLE));
+
+    /**
</ins><span class="cx">      * WebKitWebInspector::open-window:
</span><span class="cx">      * @inspector: the #WebKitWebInspector on which the signal is emitted
</span><span class="cx">      *
</span><span class="lines">@@ -311,6 +334,15 @@
</span><span class="cx">     g_object_notify(G_OBJECT(inspector), &quot;attached-height&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void didChangeAttachAvailability(WKInspectorRef, bool available, const void* clientInfo)
+{
+    WebKitWebInspector* inspector = WEBKIT_WEB_INSPECTOR(clientInfo);
+    if (inspector-&gt;priv-&gt;canAttach == available)
+        return;
+    inspector-&gt;priv-&gt;canAttach = available;
+    g_object_notify(G_OBJECT(clientInfo), &quot;can-attach&quot;);
+}
+
</ins><span class="cx"> WebKitWebInspector* webkitWebInspectorCreate(WebInspectorProxy* webInspector)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebInspector* inspector = WEBKIT_WEB_INSPECTOR(g_object_new(WEBKIT_TYPE_WEB_INSPECTOR, NULL));
</span><span class="lines">@@ -328,7 +360,8 @@
</span><span class="cx">         attach,
</span><span class="cx">         detach,
</span><span class="cx">         didChangeAttachedHeight,
</span><del>-        nullptr // didChangeAttachedWidth
</del><ins>+        nullptr, // didChangeAttachedWidth
+        didChangeAttachAvailability
</ins><span class="cx">     };
</span><span class="cx">     WKInspectorSetInspectorClientGtk(toAPI(webInspector), &amp;wkInspectorClientGtk.base);
</span><span class="cx"> 
</span><span class="lines">@@ -371,6 +404,25 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * webkit_web_inspector_get_can_attach:
+ * @inspector: a #WebKitWebInspector
+ *
+ * Whether the @inspector can be attached to the same window that contains
+ * the inspected view.
+ *
+ * Returns: %TRUE if there is enough room for the inspector view inside the
+ *     window that contains the inspected view, or %FALSE otherwise.
+ *
+ * Since: 2.8
+ */
+gboolean webkit_web_inspector_get_can_attach(WebKitWebInspector* inspector)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_INSPECTOR(inspector), FALSE);
+
+    return inspector-&gt;priv-&gt;canAttach;
+}
+
+/**
</ins><span class="cx">  * webkit_web_inspector_is_attached:
</span><span class="cx">  * @inspector: a #WebKitWebInspector
</span><span class="cx">  *
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebInspectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.h (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.h        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.h        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -83,6 +83,9 @@
</span><span class="cx"> WEBKIT_API guint
</span><span class="cx"> webkit_web_inspector_get_attached_height (WebKitWebInspector *inspector);
</span><span class="cx"> 
</span><ins>+WEBKIT_API gboolean
+webkit_web_inspector_get_can_attach      (WebKitWebInspector* inspector);
+
</ins><span class="cx"> G_END_DECLS
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtkdocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -79,5 +79,10 @@
</span><span class="cx">     &lt;xi:include href=&quot;xml/api-index-2.6.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx">   &lt;/index&gt;
</span><span class="cx"> 
</span><ins>+  &lt;index id=&quot;api-index-2-8&quot; role=&quot;2.8&quot;&gt;
+    &lt;title&gt;Index of new symbols in 2.8&lt;/title&gt;
+    &lt;xi:include href=&quot;xml/api-index-2.8.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
+  &lt;/index&gt;
+
</ins><span class="cx">   &lt;xi:include href=&quot;xml/annotation-glossary.xml&quot;&gt;&lt;xi:fallback /&gt;&lt;/xi:include&gt;
</span><span class="cx"> &lt;/book&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkdocswebkit2gtksectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -904,6 +904,7 @@
</span><span class="cx"> WebKitWebInspector
</span><span class="cx"> webkit_web_inspector_get_web_view
</span><span class="cx"> webkit_web_inspector_get_inspected_uri
</span><ins>+webkit_web_inspector_get_can_attach
</ins><span class="cx"> webkit_web_inspector_is_attached
</span><span class="cx"> webkit_web_inspector_attach
</span><span class="cx"> webkit_web_inspector_detach
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebInspectorClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.cpp (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.cpp        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.cpp        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -88,4 +88,11 @@
</span><span class="cx">     m_client.didChangeAttachedWidth(toAPI(inspector), width, m_client.base.clientInfo);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebInspectorClientGtk::didChangeAttachAvailability(WebInspectorProxy* inspector, bool available)
+{
+    if (!m_client.didChangeAttachAvailability)
+        return;
+    m_client.didChangeAttachAvailability(toAPI(inspector), available, m_client.base.clientInfo);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebInspectorClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">     bool detach(WebInspectorProxy*);
</span><span class="cx">     void didChangeAttachedHeight(WebInspectorProxy*, unsigned height);
</span><span class="cx">     void didChangeAttachedWidth(WebInspectorProxy*, unsigned width);
</span><ins>+    void didChangeAttachAvailability(WebInspectorProxy*, bool available);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -253,9 +253,9 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
</del><ins>+void WebInspectorProxy::platformAttachAvailabilityChanged(bool available)
</ins><span class="cx"> {
</span><del>-    notImplemented();
</del><ins>+    m_client.didChangeAttachAvailability(this, available);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Tools/ChangeLog        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-09-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        REGRESSION(r173929): [GTK] TestInspector fails after r173929
+        https://bugs.webkit.org/show_bug.cgi?id=137247
+
+        Reviewed by Philippe Normand.
+
+        Wait until can-attach property changes before trying to attach the
+        inspector after resizing the view.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp:
+        (testInspectorDefault):
+
</ins><span class="cx"> 2014-09-30  Eva Balazsfalvi  &lt;evab.u-szeged@partner.samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Require Python 2.7 version
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestInspectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp (174104 => 174105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp        2014-09-30 13:33:50 UTC (rev 174104)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestInspector.cpp        2014-09-30 13:38:03 UTC (rev 174105)
</span><span class="lines">@@ -125,10 +125,22 @@
</span><span class="cx">         g_main_loop_run(m_mainLoop);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static void canAttachChanged(InspectorTest* test)
+    {
+        g_main_loop_quit(test-&gt;m_mainLoop);
+    }
+
</ins><span class="cx">     void resizeViewAndAttach()
</span><span class="cx">     {
</span><span class="cx">         // Resize the view to make room for the inspector.
</span><del>-        resizeView(gMinimumAttachedInspectorWidth, (gMinimumAttachedInspectorHeight + 1) * 4 / 3);
</del><ins>+        if (!webkit_web_inspector_get_can_attach(m_inspector)) {
+            unsigned long handler = g_signal_connect_swapped(m_inspector, &quot;notify::can-attach&quot;, G_CALLBACK(canAttachChanged), this);
+            resizeView(gMinimumAttachedInspectorWidth, (gMinimumAttachedInspectorHeight + 1) * 4 / 3);
+            g_main_loop_run(m_mainLoop);
+            g_signal_handler_disconnect(m_inspector, handler);
+        }
+
+        g_assert(webkit_web_inspector_get_can_attach(m_inspector));
</ins><span class="cx">         webkit_web_inspector_attach(m_inspector);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -167,6 +179,7 @@
</span><span class="cx">     test-&gt;assertObjectIsDeletedWhenTestFinishes(G_OBJECT(inspectorView.get()));
</span><span class="cx">     g_assert(!webkit_web_inspector_is_attached(test-&gt;m_inspector));
</span><span class="cx">     g_assert_cmpuint(webkit_web_inspector_get_attached_height(test-&gt;m_inspector), ==, 0);
</span><ins>+    g_assert(!webkit_web_inspector_get_can_attach(test-&gt;m_inspector));
</ins><span class="cx">     Vector&lt;InspectorTest::InspectorEvents&gt;&amp; events = test-&gt;m_events;
</span><span class="cx">     g_assert_cmpint(events.size(), ==, 1);
</span><span class="cx">     g_assert_cmpint(events[0], ==, InspectorTest::OpenWindow);
</span></span></pre>
</div>
</div>

</body>
</html>