Bug 47311

Summary: Add layout tests for Entry.getMetadata (FileSystem API)
Product: WebKit Reporter: Kinuko Yasuda <kinuko>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ericu, levin, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch
none
Patch levin: review+

Description Kinuko Yasuda 2010-10-06 15:49:27 PDT
Add layout tests for Entry.getMetadata (FileSystem API)
Comment 1 Kinuko Yasuda 2010-10-21 13:34:10 PDT
Created attachment 71481 [details]
Patch
Comment 2 Jian Li 2010-11-29 21:28:39 PST
Comment on attachment 71481 [details]
Patch

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

> LayoutTests/fast/filesystem/resources/op-tests-helper.js:223
> +                var entryMetadataString = 'this.environment["' + symbol + '"]';

Might be better to make 'this.environment["' + symbol + '"]' a helper function in order to simplify the code.

> LayoutTests/fast/filesystem/resources/op-tests-helper.js:230
> +                this.errorCallback();

Probably we should continue to run next test even we fail the current test unless we encounter a severe error that cannot be recoverable,

> LayoutTests/fast/filesystem/resources/op-tests-helper.js:232
> +         };

'}' not aligned correctly.

> LayoutTests/fast/filesystem/resources/op-tests-helper.js:324
> +         };

ditto.

> LayoutTests/fast/filesystem/resources/op-tests-helper.js:331
> +            // Record rounded start date (current time minus 999 msec) here for the comparison. Entry.getMetadata() may return motd in seconds accuracy while new Date() is milliseconds accuracy.

What is motd?
Comment 3 Eric U. 2010-11-30 17:05:07 PST
Comment on attachment 71481 [details]
Patch

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

>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:331
>> +            // Record rounded start date (current time minus 999 msec) here for the comparison. Entry.getMetadata() may return motd in seconds accuracy while new Date() is milliseconds accuracy.
> 
> What is motd?

Why would getMetadata be so inaccurate?  Is that a filesystem limitation or part of our implementation?
Comment 4 Kinuko Yasuda 2010-12-01 11:39:33 PST
(In reply to comment #3)
> (From update of attachment 71481 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=71481&action=review
> 
> >> LayoutTests/fast/filesystem/resources/op-tests-helper.js:331
> >> +            // Record rounded start date (current time minus 999 msec) here for the comparison. Entry.getMetadata() may return motd in seconds accuracy while new Date() is milliseconds accuracy.
> > 
> > What is motd?

Ouch I think I meant mod time (last modification time).  Will fix in the next patch.
 
> Why would getMetadata be so inaccurate?  Is that a filesystem limitation or part of our implementation?

It's due to our implementation (at least for chromium).
We use WebFileInfo structure defined in WebKit API for filling metadata and WebFileInfo.modificationTime is defined as "The last modification time of the file, in seconds."
We can fix it but it'll need two-sided patch.
Comment 5 Eric U. 2010-12-01 12:46:37 PST
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 71481 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=71481&action=review
> > 
> > >> LayoutTests/fast/filesystem/resources/op-tests-helper.js:331
> > >> +            // Record rounded start date (current time minus 999 msec) here for the comparison. Entry.getMetadata() may return motd in seconds accuracy while new Date() is milliseconds accuracy.
> > > 
> > > What is motd?
> 
> Ouch I think I meant mod time (last modification time).  Will fix in the next patch.
> 
> > Why would getMetadata be so inaccurate?  Is that a filesystem limitation or part of our implementation?
> 
> It's due to our implementation (at least for chromium).
> We use WebFileInfo structure defined in WebKit API for filling metadata and WebFileInfo.modificationTime is defined as "The last modification time of the file, in seconds."
> We can fix it but it'll need two-sided patch.

Well, there's no requirement that it be any more accurate than that.  I was just curious.
Comment 6 Kinuko Yasuda 2010-12-07 18:26:36 PST
Created attachment 75859 [details]
Patch
Comment 7 Kinuko Yasuda 2010-12-07 18:28:48 PST
Comment on attachment 71481 [details]
Patch

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

>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:223
>> +                var entryMetadataString = 'this.environment["' + symbol + '"]';
> 
> Might be better to make 'this.environment["' + symbol + '"]' a helper function in order to simplify the code.

Done.

>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:230
>> +                this.errorCallback();
> 
> Probably we should continue to run next test even we fail the current test unless we encounter a severe error that cannot be recoverable,

Done.

>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:232
>> +         };
> 
> '}' not aligned correctly.

Fixed.

>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:324
>> +         };
> 
> ditto.

Fixed.

>>>>> LayoutTests/fast/filesystem/resources/op-tests-helper.js:331
>>>>> +            // Record rounded start date (current time minus 999 msec) here for the comparison. Entry.getMetadata() may return motd in seconds accuracy while new Date() is milliseconds accuracy.
>>>> 
>>>> What is motd?
>>> 
>>> Why would getMetadata be so inaccurate?  Is that a filesystem limitation or part of our implementation?
>> 
>> Ouch I think I meant mod time (last modification time).  Will fix in the next patch.
> 
> Well, there's no requirement that it be any more accurate than that.  I was just curious.

Fixed the comment.
Comment 8 WebKit Review Bot 2010-12-07 21:58:44 PST
Attachment 75859 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/update-webkit']" exit_code: 2
Updating OpenSource
Incomplete data: Delta source ended unexpectedly at /usr/lib/git-core/git-svn line 5061

Died at WebKitTools/Scripts/update-webkit line 132.


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Kinuko Yasuda 2010-12-13 13:56:12 PST
Created attachment 76433 [details]
Patch

Rebased.
Comment 10 Kinuko Yasuda 2011-01-06 23:07:52 PST
Committed r75232: <http://trac.webkit.org/changeset/75232>