Bug 66838

Summary: Extract reference links from reftest test file
Product: WebKit Reporter: Ai Makabi <makabi>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: hamaji, hayato, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 66837    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Ai Makabi
Reported 2011-08-23 22:33:46 PDT
Extract reference links from reftest test file
Attachments
Patch (6.39 KB, patch)
2011-08-24 22:01 PDT, Ai Makabi
no flags
Patch (7.50 KB, patch)
2011-08-30 22:42 PDT, Ai Makabi
no flags
Patch (7.65 KB, patch)
2011-08-31 00:18 PDT, Ai Makabi
no flags
Ai Makabi
Comment 1 2011-08-24 22:01:54 PDT
Shinichiro Hamaji
Comment 2 2011-08-24 22:53:29 PDT
Comment on attachment 105129 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105129&action=review This patch looks good, but putting r- for now as there are some nitpicks. If you didn't yet, please run ./Tools/Scripts/check-webkit-style to see if there are style issues. > Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link.py:42 > + if attrs["rel"] == "match": I think this will raise an error (KeyError) if the input html contains <link> without rel attribute. > Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link.py:48 > +def get_reference_link(html): Could you write a docstring for this? I think it should explain the argument (is this a string or a file?) and the return value (a tuple) > Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:28 > +import extract_reference_link from webkitpy.layout_tests.reftests import extract_reference_link ? I guess this won't pass ./Tools/Scripts/test-webkit-scripts , but I'm not sure. > Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:29 > + BTW, we usually put imports in alphabetical order. > Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:61 > + ["red-box-notref.xht", "red-box-notref.xht"]) It might be nice if we have another test function which exercises error cases. For example, I'd test <link> without rel, unclosed <link> (what will happen if the input is broken as an HTML...?), etc.
Ai Makabi
Comment 3 2011-08-30 22:42:04 PDT
Ai Makabi
Comment 4 2011-08-30 22:45:28 PDT
Comment on attachment 105129 [details] Patch Thank you for the review. View in context: https://bugs.webkit.org/attachment.cgi?id=105129&action=review >> Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link.py:42 >> + if attrs["rel"] == "match": > > I think this will raise an error (KeyError) if the input html contains <link> without rel attribute. Done. >> Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link.py:48 >> +def get_reference_link(html): > > Could you write a docstring for this? I think it should explain the argument (is this a string or a file?) and the return value (a tuple) Done. >> Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:28 >> +import extract_reference_link > > from webkitpy.layout_tests.reftests import extract_reference_link ? > > I guess this won't pass ./Tools/Scripts/test-webkit-scripts , but I'm not sure. Done. >> Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:29 >> + > > BTW, we usually put imports in alphabetical order. Done. >> Tools/Scripts/webkitpy/layout_tests/reftests/extract_reference_link_unittest.py:61 >> + ["red-box-notref.xht", "red-box-notref.xht"]) > > It might be nice if we have another test function which exercises error cases. For example, I'd test <link> without rel, unclosed <link> (what will happen if the input is broken as an HTML...?), etc. Done.
Kent Tamura
Comment 5 2011-08-30 23:39:34 PDT
I guess EWSs are purple because of the empty __init__.py. Would you add a comment in __init__.py please?
Ai Makabi
Comment 6 2011-08-31 00:18:11 PDT
Ai Makabi
Comment 7 2011-08-31 00:18:51 PDT
Done. (In reply to comment #5) > I guess EWSs are purple because of the empty __init__.py. Would you add a comment in __init__.py please?
Shinichiro Hamaji
Comment 8 2011-08-31 00:34:35 PDT
Comment on attachment 105752 [details] Patch Looks good. Thanks for addressing my comments.
WebKit Review Bot
Comment 9 2011-08-31 01:18:03 PDT
Comment on attachment 105752 [details] Patch Clearing flags on attachment: 105752 Committed r94160: <http://trac.webkit.org/changeset/94160>
WebKit Review Bot
Comment 10 2011-08-31 01:18:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.