<?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>159912</bug_id>
          
          <creation_ts>2016-07-18 17:49:29 -0700</creation_ts>
          <short_desc>webbookmarksd needs to use the same AppCache directory as MobileSafari</short_desc>
          <delta_ts>2016-07-19 16:08:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <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="Alex Christensen">achristensen</reporter>
          <assigned_to name="Alex Christensen">achristensen</assigned_to>
          <cc>beidson</cc>
    
    <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1212221</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 17:49:29 -0700</bug_when>
    <thetext>webbookmarksd needs to use the same AppCache directory as MobileSafari</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212222</commentid>
    <comment_count>1</comment_count>
      <attachid>283967</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 17:50:31 -0700</bug_when>
    <thetext>Created attachment 283967
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212223</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-07-18 17:51:57 -0700</bug_when>
    <thetext>Attachment 283967 did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212240</commentid>
    <comment_count>3</comment_count>
      <attachid>283967</attachid>
    <who name="">mitz</who>
    <bug_when>2016-07-18 18:52:38 -0700</bug_when>
    <thetext>Comment on attachment 283967
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=283967&amp;action=review

&gt; Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:43
&gt;      // FIXME: Ideally we should just have Safari and WebApp create a data store with

You should add webbookmarksd to the comment. It would be good to also have a reference to the Apple bug tracking fixing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212241</commentid>
    <comment_count>4</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-18 18:56:17 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Attachment 283967 [details] did not pass style-queue:
&gt; 
&gt; 
&gt; ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and
&gt; either add and list tests, or explain why no new tests were possible. 
&gt; [changelog/nonewtests] [5]
&gt; Total errors found: 1 in 5 files

This is actually testable - We&apos;ve recently started adding API tests where we manually put SQLite and data files in place, then do something with WK API to remove them, then manually check that they were removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212242</commentid>
    <comment_count>5</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 19:03:46 -0700</bug_when>
    <thetext>https://trac.webkit.org/changeset/203392</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212243</commentid>
    <comment_count>6</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 19:04:36 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; Attachment 283967 [details] did not pass style-queue:
&gt; &gt; 
&gt; &gt; 
&gt; &gt; ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and
&gt; &gt; either add and list tests, or explain why no new tests were possible. 
&gt; &gt; [changelog/nonewtests] [5]
&gt; &gt; Total errors found: 1 in 5 files
&gt; 
&gt; This is actually testable - We&apos;ve recently started adding API tests where we
&gt; manually put SQLite and data files in place, then do something with WK API
&gt; to remove them, then manually check that they were removed.
Can we change the main bundle identifier to com.apple.webbookmarksd in the tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212255</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-18 20:28:40 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #4)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; Attachment 283967 [details] did not pass style-queue:
&gt; &gt; &gt; 
&gt; &gt; &gt; 
&gt; &gt; &gt; ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and
&gt; &gt; &gt; either add and list tests, or explain why no new tests were possible. 
&gt; &gt; &gt; [changelog/nonewtests] [5]
&gt; &gt; &gt; Total errors found: 1 in 5 files
&gt; &gt; 
&gt; &gt; This is actually testable - We&apos;ve recently started adding API tests where we
&gt; &gt; manually put SQLite and data files in place, then do something with WK API
&gt; &gt; to remove them, then manually check that they were removed.
&gt; Can we change the main bundle identifier to com.apple.webbookmarksd in the
&gt; tests?

Alexey - Is there a way too spoof bundle IDs in API tests? Or do you have an alternate idea here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212257</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-07-18 20:35:40 -0700</bug_when>
    <thetext>Swizzling should work I guess.

We need to do something to make API tests scalable, I&apos;m skeptical of adding more when they run sequentially and each one is so slow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212259</commentid>
    <comment_count>9</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-18 20:49:12 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Swizzling should work I guess.
&gt; 
&gt; We need to do something to make API tests scalable, I&apos;m skeptical of adding
&gt; more when they run sequentially and each one is so slow.

This *almost* sounds like you&apos;re messaging &quot;We shouldn&apos;t add any more API tests until we find a way to make them run in parallel&quot;, but I&apos;m sure that&apos;s not your actual point ;)

I don&apos;t see why run-api-tests couldn&apos;t run multiple parallel instances of TestWebKitAPI just like run-webkit-tests does, but that&apos;s clearly out of scope for this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212267</commentid>
    <comment_count>10</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 21:30:16 -0700</bug_when>
    <thetext>cmake ports make multiple api test executables.  We could even make one per test.

I would like to add a test for this, but I wasn&apos;t aware of this &quot;Swizzling&quot;.  If someone could point me in the right direction, I&apos;ll add a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212274</commentid>
    <comment_count>11</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-18 22:22:04 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; cmake ports make multiple api test executables.  We could even make one per
&gt; test.
&gt; 
&gt; I would like to add a test for this, but I wasn&apos;t aware of this &quot;Swizzling&quot;.
&gt; If someone could point me in the right direction, I&apos;ll add a test.

http://darkdust.net/index.php/writings/objective-c/method-swizzling

So, what we want to change is this:
static String applicationBundleIdentifier()
{
    // The override only gets set in WebKit2&apos;s WebProcess and NetworkProcess. If unset, we use the main bundle identifier.
    const auto&amp; identifier = applicationBundleIdentifierOverride();
    ASSERT(identifier.isNull() || RunLoop::isMain());
    return identifier.isNull() ? String([[NSBundle mainBundle] bundleIdentifier]) : identifier;
}

So you&apos;d swizzle the -[NSBundle bundleIdentifier] method to be the fake one, run the test, then swizzle it back.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212275</commentid>
    <comment_count>12</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-18 22:22:43 -0700</bug_when>
    <thetext>Also https://blog.newrelic.com/2014/04/16/right-way-to-swizzle/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212288</commentid>
    <comment_count>13</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-18 23:57:04 -0700</bug_when>
    <thetext>Oh, THAT swizzling.  I verified this fix manually.  I&apos;m not sure how much value it would add to have a test that uses swizzling to verify the existence of an iOS-specific hack that we want to get rid of.  My complete lack of testing isn&apos;t the best, either...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212398</commentid>
    <comment_count>14</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2016-07-19 09:47:36 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; Oh, THAT swizzling.  I verified this fix manually.  I&apos;m not sure how much
&gt; value it would add to have a test that uses swizzling to verify the
&gt; existence of an iOS-specific hack that we want to get rid of.  

The value is that we don&apos;t regress again in the meantime.

&quot;Regression tests&quot; &lt;--- It&apos;s right there in the name.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1212582</commentid>
    <comment_count>15</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2016-07-19 16:08:19 -0700</bug_when>
    <thetext>Regression tests added in https://bugs.webkit.org/show_bug.cgi?id=159949</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>283967</attachid>
            <date>2016-07-18 17:50:31 -0700</date>
            <delta_ts>2016-07-18 18:29:25 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-159912-20160718174936.patch</filename>
            <type>text/plain</type>
            <size>3889</size>
            <attacher name="Alex Christensen">achristensen</attacher>
            
              <data encoding="base64">SW5kZX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pZ3Jh
dGUgZGF0YSB3aGVuIHVwZ3JhZGluZy4KICAgICAvLyBGSVhNRTogSWRlYWxseSB3ZSBzaG91bGQg
anVzdCBoYXZlIFNhZmFyaSBhbmQgV2ViQXBwIGNyZWF0ZSBhIGRhdGEgc3RvcmUgd2l0aAogICAg
IC8vIHRoaXMgYXBwbGljYXRpb24gY2FjaGUgcGF0aCwgYnV0IHRoYXQncyBub3Qgc3VwcG9ydGVk
IGFzIG9mIHJpZ2h0IG5vdy4KLSAgICBpZiAoV2ViQ29yZTo6SU9TQXBwbGljYXRpb246OmlzTW9i
aWxlU2FmYXJpKCkgfHwgV2ViQ29yZTo6SU9TQXBwbGljYXRpb246OmlzV2ViQXBwKCkpIHsKKyAg
ICBpZiAoV2ViQ29yZTo6SU9TQXBwbGljYXRpb246OmlzTW9iaWxlU2FmYXJpKCkgfHwgV2ViQ29y
ZTo6SU9TQXBwbGljYXRpb246OmlzV2ViQXBwKCkgfHwgV2ViQ29yZTo6SU9TQXBwbGljYXRpb246
OmlzV2ViQm9va21hcmtzRCgpKSB7CiAgICAgICAgIE5TU3RyaW5nICpjYWNoZVBhdGggPSBbTlNI
b21lRGlyZWN0b3J5KCkgc3RyaW5nQnlBcHBlbmRpbmdQYXRoQ29tcG9uZW50OkAiTGlicmFyeS9D
YWNoZXMvY29tLmFwcGxlLldlYkFwcENhY2hlIl07CiAKICAgICAgICAgcmV0dXJuIFdlYktpdDo6
c3RyaW5nQnlSZXNvbHZpbmdTeW1saW5rc0luUGF0aChjYWNoZVBhdGguc3RyaW5nQnlTdGFuZGFy
ZGl6aW5nUGF0aCk7Cg==
</data>
<flag name="review"
          id="307622"
          type_id="1"
          status="+"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>