Title: [205447] trunk
Revision
205447
Author
[email protected]
Date
2016-09-05 03:30:07 -0700 (Mon, 05 Sep 2016)

Log Message

W3C test importer should generate the list of resource files
https://bugs.webkit.org/show_bug.cgi?id=161578

Patch by Youenn Fablet <[email protected]> on 2016-09-05
Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

* resources/resource-files.json: Reformatting the file.

Tools:

Generating LayoutTests/imported/w3c/resources/resource-files.json when importing tests.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.__init__): Reading test resource files configuration file.
(TestImporter.find_importable_tests):
(TestImporter.import_tests): Update the test resource files based on test parsed files.
(TestImporter):
(TestImporter._already_identified_as_resource_file): Helper routine to know whether a file is already set as a resource file.
(TestImporter._is_in_resources_directory: Helper routine to know whether a file is in a resources directory.

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (205446 => 205447)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-09-05 09:53:17 UTC (rev 205446)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-09-05 10:30:07 UTC (rev 205447)
@@ -1,3 +1,12 @@
+2016-09-05  Youenn Fablet  <[email protected]>
+
+        W3C test importer should generate the list of resource files
+        https://bugs.webkit.org/show_bug.cgi?id=161578
+
+        Reviewed by Ryosuke Niwa.
+
+        * resources/resource-files.json: Reformatting the file.
+
 2016-09-03  Chris Dumez  <[email protected]>
 
         Align meta element http-equiv="refresh" parsing with the HTML specification

Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (205446 => 205447)


--- trunk/LayoutTests/imported/w3c/resources/resource-files.json	2016-09-05 09:53:17 UTC (rev 205446)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json	2016-09-05 10:30:07 UTC (rev 205447)
@@ -1,219 +1,222 @@
-{"directories": [
-"web-platform-tests/common",
-"web-platform-tests/dom/nodes/Document-createElement-namespace-tests",
-"web-platform-tests/fonts",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/source/support",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/support",
-"web-platform-tests/html/browsers/history/the-history-interface/non-automated",
-"web-platform-tests/html/browsers/history/the-location-interface/non-automated",
-"web-platform-tests/images",
-"web-platform-tests/service-workers",
-"web-platform-tests/tools"
-], "files": [
-"web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html",
-"web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html",
-"web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html",
-"web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html",
-"web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html",
-"web-platform-tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml",
-"web-platform-tests/dom/nodes/Node-isEqualNode-iframe1.xml",
-"web-platform-tests/dom/nodes/Node-isEqualNode-iframe2.xml",
-"web-platform-tests/dom/nodes/Node-parentNode-iframe.html",
-"web-platform-tests/dom/nodes/ParentNode-querySelector-All-content.html",
-"web-platform-tests/dom/nodes/ParentNode-querySelector-All-content.xht",
-"web-platform-tests/dom/nodes/getElementsByClassNameFrame.htm",
-"web-platform-tests/dom/ranges/Range-test-iframe.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/001-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/001-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html",
-"web-platform-tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/click.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/href.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/base.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html",
-"web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html",
-"web-platform-tests/html/browsers/history/the-history-interface/009-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/009-3.html",
-"web-platform-tests/html/browsers/history/the-history-interface/009-5.html",
-"web-platform-tests/html/browsers/history/the-history-interface/010-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/010-3.html",
-"web-platform-tests/html/browsers/history/the-history-interface/010-5.html",
-"web-platform-tests/html/browsers/history/the-history-interface/blank.html",
-"web-platform-tests/html/browsers/history/the-history-interface/blank2.html",
-"web-platform-tests/html/browsers/history/the-history-interface/blank3.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_back-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_entry.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_forward-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_forward-2.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_go_undefined-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/history_go_zero-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/filler.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html",
-"web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/assign_after_load-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/assign_after_load-2.html",
-"web-platform-tests/html/browsers/history/the-location-interface/assign_before_load-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/assign_before_load-2.html",
-"web-platform-tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html",
-"web-platform-tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html",
-"web-platform-tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/reload_document_write-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/reload_post_1-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/same_origin_frame.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html",
-"web-platform-tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html",
-"web-platform-tests/html/browsers/offline/resources/html/clock.html",
-"web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html",
-"web-platform-tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html",
-"web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html",
-"web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html",
-"web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html",
-"web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html",
-"web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html",
-"web-platform-tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/001-1.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/existing.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/message.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/parent1.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/parent2.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/self1.html",
-"web-platform-tests/html/browsers/windows/browsing-context-names/self2.html",
-"web-platform-tests/html/browsers/windows/nested-browsing-contexts/test.html",
-"web-platform-tests/html/browsers/windows/nested-browsing-contexts/testcase3.html",
-"web-platform-tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html",
-"web-platform-tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html",
-"web-platform-tests/html/browsers/windows/support-close.html",
-"web-platform-tests/html/browsers/windows/support-named-null-opener.html",
-"web-platform-tests/html/browsers/windows/support-nested-browsing-contexts.html",
-"web-platform-tests/html/browsers/windows/support-opener-null.html",
-"web-platform-tests/html/browsers/windows/support-post-to-opener.html",
-"web-platform-tests/html/browsers/windows/support-window-name-echo.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html",
-"web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html",
-"web-platform-tests/html/semantics/document-metadata/the-base-element/example.html",
-"web-platform-tests/html/semantics/document-metadata/the-base-element/example2.html",
-"web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html",
-"web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm",
-"web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html",
-"web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html",
-"web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html",
-"web-platform-tests/html/semantics/embedded-content/the-object-element/test0.html",
-"web-platform-tests/html/semantics/embedded-content/the-object-element/test1.html",
-"web-platform-tests/html/semantics/embedded-content/the-object-element/test2.html",
-"web-platform-tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html",
-"web-platform-tests/html/semantics/forms/the-button-element/button-activate-frame.html",
-"web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html",
-"web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html",
-"web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html",
-"web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html",
-"web-platform-tests/html/semantics/selectors/pseudo-classes/focus-iframe.html",
-"web-platform-tests/resource-timing/iframe-setdomain.sub.html"
-]}
+{
+    "directories": [
+        "web-platform-tests/common",
+        "web-platform-tests/dom/nodes/Document-createElement-namespace-tests",
+        "web-platform-tests/fonts",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/source/support",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/support",
+        "web-platform-tests/html/browsers/history/the-history-interface/non-automated",
+        "web-platform-tests/html/browsers/history/the-location-interface/non-automated",
+        "web-platform-tests/images",
+        "web-platform-tests/service-workers",
+        "web-platform-tests/tools"
+    ],
+    "files": [
+        "web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html",
+        "web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html",
+        "web-platform-tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html",
+        "web-platform-tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html",
+        "web-platform-tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html",
+        "web-platform-tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml",
+        "web-platform-tests/dom/nodes/Node-isEqualNode-iframe1.xml",
+        "web-platform-tests/dom/nodes/Node-isEqualNode-iframe2.xml",
+        "web-platform-tests/dom/nodes/Node-parentNode-iframe.html",
+        "web-platform-tests/dom/nodes/ParentNode-querySelector-All-content.html",
+        "web-platform-tests/dom/nodes/ParentNode-querySelector-All-content.xht",
+        "web-platform-tests/dom/nodes/getElementsByClassNameFrame.htm",
+        "web-platform-tests/dom/ranges/Range-test-iframe.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/001-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/001-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html",
+        "web-platform-tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/001-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/002-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/002-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/blank.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_location-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/child_navigates_parent_submit-3.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/click.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/href.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_data_url-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/navigation_unload_same_origin-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/base.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001-1.html",
+        "web-platform-tests/html/browsers/browsing-the-web/unloading-documents/unload/manual-001.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/009-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/009-3.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/009-5.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/010-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/010-3.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/010-5.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/blank.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/blank2.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/blank3.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_back-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_entry.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_forward-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_forward-2.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_go_undefined-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/history_go_zero-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/joint_session_history/filler.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html",
+        "web-platform-tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/assign_after_load-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/assign_after_load-2.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/assign_before_load-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/assign_before_load-2.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/location_reload-iframe.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/reload_document_write-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/reload_post_1-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/same_origin_frame.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html",
+        "web-platform-tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html",
+        "web-platform-tests/html/browsers/offline/resources/html/clock.html",
+        "web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html",
+        "web-platform-tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html",
+        "web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html",
+        "web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html",
+        "web-platform-tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_beforeunload-1.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_script_defer-1.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/close_unload-1.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-1.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001-2.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/001.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-1.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002-2.html",
+        "web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/non_automated/002.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html",
+        "web-platform-tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html",
+        "web-platform-tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/001-1.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/002-1.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/existing.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/message.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/parent1.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/parent2.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/self1.html",
+        "web-platform-tests/html/browsers/windows/browsing-context-names/self2.html",
+        "web-platform-tests/html/browsers/windows/nested-browsing-contexts/test.html",
+        "web-platform-tests/html/browsers/windows/nested-browsing-contexts/testcase3.html",
+        "web-platform-tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html",
+        "web-platform-tests/html/browsers/windows/noreferrer-cross-origin-window-name.sub.html",
+        "web-platform-tests/html/browsers/windows/support-close.html",
+        "web-platform-tests/html/browsers/windows/support-named-null-opener.html",
+        "web-platform-tests/html/browsers/windows/support-nested-browsing-contexts.html",
+        "web-platform-tests/html/browsers/windows/support-opener-null.html",
+        "web-platform-tests/html/browsers/windows/support-post-to-opener.html",
+        "web-platform-tests/html/browsers/windows/support-window-name-echo.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/document-write/nested-document-write-2.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/004-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-2.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/011-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/012-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/013-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/014-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/015-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/016-1.html",
+        "web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-03-frame.html",
+        "web-platform-tests/html/semantics/document-metadata/the-base-element/example.html",
+        "web-platform-tests/html/semantics/document-metadata/the-base-element/example2.html",
+        "web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-iframe.html",
+        "web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-in-object-fallback-subdocument.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_child.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/change_grandchild.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/cross_origin_grandchild.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_helper.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_child.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/same_origin_grandchild.html",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/blank.htm",
+        "web-platform-tests/html/semantics/embedded-content/the-iframe-element/support/sandbox_allow_script.html",
+        "web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/iframed.sub.html",
+        "web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/sizes-iframed.sub.html",
+        "web-platform-tests/html/semantics/embedded-content/the-object-element/test0.html",
+        "web-platform-tests/html/semantics/embedded-content/the-object-element/test1.html",
+        "web-platform-tests/html/semantics/embedded-content/the-object-element/test2.html",
+        "web-platform-tests/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr-iframe.html",
+        "web-platform-tests/html/semantics/forms/the-button-element/button-activate-frame.html",
+        "web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1a.html",
+        "web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1b.html",
+        "web-platform-tests/html/semantics/grouping-content/the-ol-element/reversed-1c.html",
+        "web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-executed-after-shutdown-child.html",
+        "web-platform-tests/html/semantics/selectors/pseudo-classes/focus-iframe.html",
+        "web-platform-tests/resource-timing/iframe-setdomain.sub.html"
+    ]
+}
\ No newline at end of file

Modified: trunk/Tools/ChangeLog (205446 => 205447)


--- trunk/Tools/ChangeLog	2016-09-05 09:53:17 UTC (rev 205446)
+++ trunk/Tools/ChangeLog	2016-09-05 10:30:07 UTC (rev 205447)
@@ -1,3 +1,20 @@
+2016-09-05  Youenn Fablet  <[email protected]>
+
+        W3C test importer should generate the list of resource files
+        https://bugs.webkit.org/show_bug.cgi?id=161578
+
+        Reviewed by Ryosuke Niwa.
+
+        Generating LayoutTests/imported/w3c/resources/resource-files.json when importing tests.
+
+        * Scripts/webkitpy/w3c/test_importer.py:
+        (TestImporter.__init__): Reading test resource files configuration file.
+        (TestImporter.find_importable_tests):
+        (TestImporter.import_tests): Update the test resource files based on test parsed files.
+        (TestImporter):
+        (TestImporter._already_identified_as_resource_file): Helper routine to know whether a file is already set as a resource file.
+        (TestImporter._is_in_resources_directory: Helper routine to know whether a file is in a resources directory.
+
 2016-09-03  Wenson Hsieh  <[email protected]>
 
         Media controls behave strangely when videos mute from within a playing handler

Modified: trunk/Tools/Scripts/webkitpy/w3c/test_importer.py (205446 => 205447)


--- trunk/Tools/Scripts/webkitpy/w3c/test_importer.py	2016-09-05 09:53:17 UTC (rev 205446)
+++ trunk/Tools/Scripts/webkitpy/w3c/test_importer.py	2016-09-05 10:30:07 UTC (rev 205447)
@@ -74,16 +74,14 @@
 """
 
 import argparse
-import datetime
+import json
 import logging
 import mimetypes
-import os
 import sys
 
 from webkitpy.common.host import Host
 from webkitpy.common.system.filesystem import FileSystem
 from webkitpy.common.webkit_finder import WebKitFinder
-from webkitpy.common.system.executive import ScriptError
 from webkitpy.w3c.test_parser import TestParser
 from webkitpy.w3c.test_converter import convert_for_webkit
 from webkitpy.w3c.test_downloader import TestDownloader
@@ -180,6 +178,11 @@
         self.import_list = []
         self._importing_downloaded_tests = source_directory is None
 
+        self._test_resource_files_json_path = self.filesystem.join(self.layout_tests_w3c_path, "resources", "resource-files.json")
+        self._test_resource_files = json.loads(self.filesystem.read_text_file(self._test_resource_files_json_path)) if self.filesystem.exists(self._test_resource_files_json_path) else None
+        if self.options.clean_destination_directory:
+            self._test_resource_files["files"] = []
+
     def do_import(self):
         if not self.source_directory:
             _log.info('Downloading W3C test repositories')
@@ -294,11 +297,13 @@
                 test_parser = TestParser(vars(self.options), filename=fullpath, host=self.host)
                 test_info = test_parser.analyze_test()
                 if test_info is None:
-                    # This is probably a resource file.
-                    if self.filesystem.basename(self.filesystem.dirname(fullpath)) != "resources":
-                        self._potential_test_resource_files.append({'src': fullpath, 'dest': filename})
+                    # This is probably a resource file, but we should generate WPT manifest instead and get the list of resource files from it.
+                    if not self._is_in_resources_directory(fullpath):
+                        self._potential_test_resource_files.append(fullpath)
                     copy_list.append({'src': fullpath, 'dest': filename})
                     continue
+                elif self._is_in_resources_directory(fullpath):
+                    _log.warning('%s is a test located in a "resources" folder. This test will be skipped by WebKit test runners.', fullpath)
 
                 if 'manualtest' in test_info.keys():
                     continue
@@ -462,11 +467,27 @@
         for prefixed_value in sorted(total_prefixed_property_values, key=lambda p: total_prefixed_property_values[p]):
             _log.info('  %s: %s', prefixed_value, total_prefixed_property_values[prefixed_value])
 
-        if self._potential_test_resource_files:
-            _log.info('The following files may be resource files and should be marked as skipped in the TestExpectations:')
-            for filename in sorted([test['src'] for test in self._potential_test_resource_files]):
-                _log.info(filename.replace(self.source_directory, self.tests_w3c_relative_path) + ' [ Skip ]')
+        if self._potential_test_resource_files and self._test_resource_files:
+            # FIXME: We should check that actual tests are not in the test_resource_files list
+            should_update_json_file = False
+            files = self._test_resource_files["files"]
+            for full_path in self._potential_test_resource_files:
+                resource_file_path = self.filesystem.relpath(full_path, self.source_directory)
+                if not self._already_identified_as_resource_file(resource_file_path):
+                    files.append(resource_file_path)
+                    should_update_json_file = True
+            if should_update_json_file:
+                files.sort()
+                self.filesystem.write_text_file(self._test_resource_files_json_path, json.dumps(self._test_resource_files, sort_keys=True, indent=4).replace(' \n', '\n'))
 
+    def _already_identified_as_resource_file(self, path):
+        if path in self._test_resource_files["files"]:
+            return True
+        return any([path.find(directory) != -1 for directory in self._test_resource_files["directories"]])
+
+    def _is_in_resources_directory(self, path):
+        return "resources" in path.split(self.filesystem.sep)
+
     def remove_deleted_files(self, import_directory, new_file_list):
         """ Reads an import log in |import_directory|, compares it to the |new_file_list|, and removes files not in the new list."""
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to