<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>168193</bug_id>
          
          <creation_ts>2017-02-12 11:08:02 -0800</creation_ts>
          <short_desc>REGRESSION(r212192): [GTK] Broke downloads API tests</short_desc>
          <delta_ts>2017-02-14 05:05:08 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=168163</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1276004</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-02-12 11:08:02 -0800</bug_when>
    <thetext>Implementing MIMETypeRegistry::getPreferredExtensionForMIMEType in r212192 broke our downloads API test:

TEST: ./Tools/gtk/../../WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/TestDownloads... (pid=31826)

  /webkit2/Downloads/local-file:                                       OK

  /webkit2/Downloads/overwrite-destination-allowed:                    OK

  /webkit2/Downloads/overwrite-destination-disallowed:                 OK

  /webkit2/Downloads/local-file-error:                                 OK

  /webkit2/Downloads/remote-file:                                      **

ERROR:../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:186:void DownloadTest::checkDestinationAndDeleteFile(WebKitDownload*, const char*): assertion failed (destBasename.get() == expectedName): (&quot;webkit-downloaded-file.pdf&quot; == &quot;webkit-downloaded-file&quot;)

FAIL

I guess it&apos;s now expected that the .pdf file extension be added even though it&apos;s not included in the server suggested filename, so the change was correct and the test should be updated, right? It seems a bit odd that we would add the file extension on the client side, but I guess that&apos;s the expected behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1276093</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-02-12 22:09:56 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; Implementing MIMETypeRegistry::getPreferredExtensionForMIMEType in r212192
&gt; broke our downloads API test:
&gt; 
&gt; TEST:
&gt; ./Tools/gtk/../../WebKitBuild/Release/bin/TestWebKitAPI/WebKit2Gtk/
&gt; TestDownloads... (pid=31826)
&gt; 
&gt;   /webkit2/Downloads/local-file:                                       OK
&gt; 
&gt;   /webkit2/Downloads/overwrite-destination-allowed:                    OK
&gt; 
&gt;   /webkit2/Downloads/overwrite-destination-disallowed:                 OK
&gt; 
&gt;   /webkit2/Downloads/local-file-error:                                 OK
&gt; 
&gt;   /webkit2/Downloads/remote-file:                                      **
&gt; 
&gt; ERROR:../../Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:186:void
&gt; DownloadTest::checkDestinationAndDeleteFile(WebKitDownload*, const char*):
&gt; assertion failed (destBasename.get() == expectedName):
&gt; (&quot;webkit-downloaded-file.pdf&quot; == &quot;webkit-downloaded-file&quot;)
&gt; 
&gt; FAIL
&gt; 
&gt; I guess it&apos;s now expected that the .pdf file extension be added even though
&gt; it&apos;s not included in the server suggested filename, so the change was
&gt; correct and the test should be updated, right? It seems a bit odd that we
&gt; would add the file extension on the client side, but I guess that&apos;s the
&gt; expected behavior?

Yes, it&apos;s a matter of checking the extension now too. I was going to do it yesterday but was tired, I&apos;ll fix this today. It&apos;s the suggested filename, it&apos;s perfectly ok to suggest a filename with a extension when we know the mime type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1276687</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2017-02-14 05:05:08 -0800</bug_when>
    <thetext>Committed r212290: &lt;http://trac.webkit.org/changeset/212290&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>