Bug 47311 - Add layout tests for Entry.getMetadata (FileSystem API)
Summary: Add layout tests for Entry.getMetadata (FileSystem API)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-06 15:49 PDT by Kinuko Yasuda
Modified: 2011-01-06 23:07 PST (History)
3 users (show)

See Also:


Attachments
Patch (7.47 KB, patch)
2010-10-21 13:34 PDT, Kinuko Yasuda
no flags Details | Formatted Diff | Diff
Patch (10.06 KB, patch)
2010-12-07 18:26 PST, Kinuko Yasuda
no flags Details | Formatted Diff | Diff
Patch (10.03 KB, patch)
2010-12-13 13:56 PST, Kinuko Yasuda
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>