Bug 1258916 part 3 - Add suffix for reference files if neither suffix nor prefix is present.
MozReview-Commit-ID: Bybbt1ffIMo
--- a/layout/reftests/w3c-css/import-tests.py
+++ b/layout/reftests/w3c-css/import-tests.py
@@ -147,30 +147,36 @@ def copy_support_files(test, dirname, sp
return
for dirpath, dirnames, filenames in os.walk(support_dir):
for fn in filenames:
if fn == "LOCK":
continue
full_fn = os.path.join(dirpath, fn)
copy_file(test, full_fn, os.path.join(spec, "support", full_fn[len(support_dir)+1:]), True)
-def map_file(fn, spec):
+def map_file(fn, spec, type=None):
if fn in filemap:
return filemap[fn]
- destname = os.path.join(spec, os.path.basename(fn))
+ filename, ext = os.path.splitext(os.path.basename(fn))
+ # Rename the file to add a suffix if neither prefix nor suffix is
+ # present in filename to avoid potential name conflict.
+ if type and not (filename.startswith(type + "-") or
+ filename.endswith("-" + type)):
+ filename += "-" + type
+ filename += ext
+ destname = os.path.join(spec, filename)
filemap[fn] = destname
- load_flags_for(fn, spec)
+ load_flags_for(fn, destname)
copy_file(destname, fn, destname, False)
copy_support_files(destname, os.path.dirname(fn), spec)
return destname
-def load_flags_for(fn, spec):
+def load_flags_for(fn, destname):
global gTestFlags
document = get_document_for(fn)
- destname = os.path.join(spec, os.path.basename(fn))
gTestFlags[destname] = []
for meta in document.getElementsByTagName("meta"):
name = meta.getAttribute("name")
if name == "flags":
gTestFlags[destname] = meta.getAttribute("content").split()
def get_document_for(fn):
@@ -204,19 +210,19 @@ def add_test_items(fn, spec):
if spec is None:
for subtree in gSubtrees:
if fn.startswith(subtree):
spec = os.path.basename(subtree)
break
else:
raise StandardError("Could not associate test " + fn + " with specification")
for ref in refs:
- tests.append(["==", map_file(fn, spec), map_file(ref, spec)])
+ tests.append(["==", map_file(fn, spec), map_file(ref, spec, "ref")])
for notref in notrefs:
- tests.append(["!=", map_file(fn, spec), map_file(notref, spec)])
+ tests.append(["!=", map_file(fn, spec), map_file(notref, spec, "notref")])
# Add chained references too
for ref in refs:
add_test_items(ref, spec=spec)
for notref in notrefs:
add_test_items(notref, spec=spec)
def copy_and_prefix(test, aSourceFileName, aDestFileName, aProps, isSupportFile=False):
global gTestFlags
rename from layout/reftests/w3c-css/received/css-conditional-3/background-lime.html
rename to layout/reftests/w3c-css/received/css-conditional-3/background-lime-ref.html
rename from layout/reftests/w3c-css/received/css-values-3/200-200-green.html
rename to layout/reftests/w3c-css/received/css-values-3/200-200-green-ref.html
rename from layout/reftests/w3c-css/received/css-values-3/all-green.html
rename to layout/reftests/w3c-css/received/css-values-3/all-green-ref.html
--- a/layout/reftests/w3c-css/received/import.log
+++ b/layout/reftests/w3c-css/received/import.log
@@ -1,12 +1,12 @@
Importing revision: c6d8b262affdb14c8dad76a73629b484a3737819
from repository: https://hg.csswg.org/test
Importing css-conditional-3/at-media-whitespace-optional-001.html to css-conditional-3/at-media-whitespace-optional-001.html
-Importing css-conditional-3/reference/background-lime.html to css-conditional-3/background-lime.html
+Importing css-conditional-3/reference/background-lime.html to css-conditional-3/background-lime-ref.html
Importing css-conditional-3/at-media-whitespace-optional-002.html to css-conditional-3/at-media-whitespace-optional-002.html
Importing css-conditional-3/at-supports-001.html to css-conditional-3/at-supports-001.html
Importing css-conditional-3/at-supports-001-ref.html to css-conditional-3/at-supports-001-ref.html
Importing css-conditional-3/at-supports-002.html to css-conditional-3/at-supports-002.html
Importing css-conditional-3/at-supports-003.html to css-conditional-3/at-supports-003.html
Importing css-conditional-3/at-supports-004.html to css-conditional-3/at-supports-004.html
Importing css-conditional-3/at-supports-005.html to css-conditional-3/at-supports-005.html
Importing css-conditional-3/at-supports-006.html to css-conditional-3/at-supports-006.html
@@ -119,32 +119,32 @@ Importing css-values-3/support/test-bl.p
Importing css-values-3/support/test-br.png to css-values-3/support/test-br.png
Importing css-values-3/support/test-inner-half-size.png to css-values-3/support/test-inner-half-size.png
Importing css-values-3/support/test-outer.png to css-values-3/support/test-outer.png
Importing css-values-3/support/test-tl.png to css-values-3/support/test-tl.png
Importing css-values-3/support/test-tr.png to css-values-3/support/test-tr.png
Importing css-values-3/support/support/README to css-values-3/support/support/README
Importing css-values-3/support/support/swatch-green.png to css-values-3/support/support/swatch-green.png
Importing css-values-3/support/support/swatch-red.png to css-values-3/support/support/swatch-red.png
-Importing css-values-3/reference/200-200-green.html to css-values-3/200-200-green.html
+Importing css-values-3/reference/200-200-green.html to css-values-3/200-200-green-ref.html
Importing css-values-3/attr-color-invalid-fallback.html to css-values-3/attr-color-invalid-fallback.html
Importing css-values-3/attr-color-valid.html to css-values-3/attr-color-valid.html
Importing css-values-3/attr-invalid-type-001.html to css-values-3/attr-invalid-type-001.html
Importing css-values-3/attr-invalid-type-002.html to css-values-3/attr-invalid-type-002.html
Importing css-values-3/attr-invalid-type-003.html to css-values-3/attr-invalid-type-003.html
Importing css-values-3/attr-length-invalid-cast.html to css-values-3/attr-length-invalid-cast.html
Importing css-values-3/attr-length-invalid-fallback.html to css-values-3/attr-length-invalid-fallback.html
Importing css-values-3/attr-length-valid-zero-nofallback.html to css-values-3/attr-length-valid-zero-nofallback.html
Importing css-values-3/attr-length-valid-zero.html to css-values-3/attr-length-valid-zero.html
Importing css-values-3/attr-length-valid.html to css-values-3/attr-length-valid.html
Importing css-values-3/attr-px-invalid-cast.html to css-values-3/attr-px-invalid-cast.html
Importing css-values-3/attr-px-invalid-fallback.html to css-values-3/attr-px-invalid-fallback.html
Importing css-values-3/attr-px-valid.html to css-values-3/attr-px-valid.html
Importing css-values-3/calc-in-calc.html to css-values-3/calc-in-calc.html
-Importing css-values-3/reference/all-green.html to css-values-3/all-green.html
+Importing css-values-3/reference/all-green.html to css-values-3/all-green-ref.html
Importing css-values-3/calc-in-media-queries-001.html to css-values-3/calc-in-media-queries-001.html
Importing css-values-3/calc-in-media-queries-002.html to css-values-3/calc-in-media-queries-002.html
Importing css-values-3/calc-invalid-range-clamping.html to css-values-3/calc-invalid-range-clamping.html
Importing css-values-3/calc-parenthesis-stack.html to css-values-3/calc-parenthesis-stack.html
Importing css-values-3/ch-unit-001.html to css-values-3/ch-unit-001.html
Importing css-values-3/reference/ch-unit-001-ref.html to css-values-3/ch-unit-001-ref.html
Importing css-values-3/initial-background-color.html to css-values-3/initial-background-color.html
Importing css-values-3/vh-calc-support-pct.html to css-values-3/vh-calc-support-pct.html
--- a/layout/reftests/w3c-css/received/reftest.list
+++ b/layout/reftests/w3c-css/received/reftest.list
@@ -1,12 +1,12 @@
# THIS FILE IS AUTOGENERATED BY import-tests.py
# DO NOT EDIT!
-== css-conditional-3/at-media-whitespace-optional-001.html css-conditional-3/background-lime.html
-== css-conditional-3/at-media-whitespace-optional-002.html css-conditional-3/background-lime.html
+== css-conditional-3/at-media-whitespace-optional-001.html css-conditional-3/background-lime-ref.html
+== css-conditional-3/at-media-whitespace-optional-002.html css-conditional-3/background-lime-ref.html
== css-conditional-3/at-supports-001.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-002.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-003.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-004.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-005.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-006.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-007.html css-conditional-3/at-supports-001-ref.html
== css-conditional-3/at-supports-008.html css-conditional-3/at-supports-001-ref.html
@@ -59,44 +59,44 @@
== css-namespaces-3/syntax-008.xml css-namespaces-3/ref-lime-2.xml
== css-namespaces-3/syntax-009.xml css-namespaces-3/ref-lime-1.xml
== css-namespaces-3/syntax-010.xml css-namespaces-3/ref-lime-3.xml
== css-namespaces-3/syntax-011.xml css-namespaces-3/ref-lime-6.xml
== css-namespaces-3/syntax-012.xml css-namespaces-3/ref-lime-3.xml
== css-namespaces-3/syntax-013.xml css-namespaces-3/ref-lime-5.xml
== css-namespaces-3/syntax-014.xml css-namespaces-3/ref-lime-3.xml
== css-namespaces-3/syntax-015.xml css-namespaces-3/ref-lime-1.xml
-fails == css-values-3/attr-color-invalid-cast.html css-values-3/200-200-green.html
-== css-values-3/attr-color-invalid-fallback.html css-values-3/200-200-green.html
-fails == css-values-3/attr-color-valid.html css-values-3/200-200-green.html
-== css-values-3/attr-invalid-type-001.html css-values-3/200-200-green.html
-== css-values-3/attr-invalid-type-002.html css-values-3/200-200-green.html
-== css-values-3/attr-invalid-type-003.html css-values-3/200-200-green.html
-fails == css-values-3/attr-length-invalid-cast.html css-values-3/200-200-green.html
-== css-values-3/attr-length-invalid-fallback.html css-values-3/200-200-green.html
-fails == css-values-3/attr-length-valid-zero-nofallback.html css-values-3/200-200-green.html
-fails == css-values-3/attr-length-valid-zero.html css-values-3/200-200-green.html
-fails == css-values-3/attr-length-valid.html css-values-3/200-200-green.html
-fails == css-values-3/attr-px-invalid-cast.html css-values-3/200-200-green.html
-== css-values-3/attr-px-invalid-fallback.html css-values-3/200-200-green.html
-fails == css-values-3/attr-px-valid.html css-values-3/200-200-green.html
-== css-values-3/calc-in-calc.html css-values-3/all-green.html
-fails == css-values-3/calc-in-media-queries-001.html css-values-3/all-green.html
-fails == css-values-3/calc-in-media-queries-002.html css-values-3/all-green.html
-== css-values-3/calc-invalid-range-clamping.html css-values-3/200-200-green.html
-== css-values-3/calc-parenthesis-stack.html css-values-3/all-green.html
+fails == css-values-3/attr-color-invalid-cast.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-color-invalid-fallback.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-color-valid.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-invalid-type-001.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-invalid-type-002.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-invalid-type-003.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-length-invalid-cast.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-length-invalid-fallback.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-length-valid-zero-nofallback.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-length-valid-zero.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-length-valid.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-px-invalid-cast.html css-values-3/200-200-green-ref.html
+== css-values-3/attr-px-invalid-fallback.html css-values-3/200-200-green-ref.html
+fails == css-values-3/attr-px-valid.html css-values-3/200-200-green-ref.html
+== css-values-3/calc-in-calc.html css-values-3/all-green-ref.html
+fails == css-values-3/calc-in-media-queries-001.html css-values-3/all-green-ref.html
+fails == css-values-3/calc-in-media-queries-002.html css-values-3/all-green-ref.html
+== css-values-3/calc-invalid-range-clamping.html css-values-3/200-200-green-ref.html
+== css-values-3/calc-parenthesis-stack.html css-values-3/all-green-ref.html
skip == css-values-3/ch-unit-001.html css-values-3/ch-unit-001-ref.html
-== css-values-3/initial-background-color.html css-values-3/all-green.html
-== css-values-3/vh-calc-support-pct.html css-values-3/all-green.html
-== css-values-3/vh-calc-support.html css-values-3/all-green.html
-== css-values-3/vh-em-inherit.html css-values-3/all-green.html
-== css-values-3/vh-inherit.html css-values-3/all-green.html
-== css-values-3/vh-interpolate-pct.html css-values-3/all-green.html
-== css-values-3/vh-interpolate-px.html css-values-3/all-green.html
-== css-values-3/vh-interpolate-vh.html css-values-3/all-green.html
-== css-values-3/vh-support-atviewport.html css-values-3/all-green.html
-== css-values-3/vh-support-margin.html css-values-3/all-green.html
-skip == css-values-3/vh-support-transform-origin.html css-values-3/all-green.html
-skip == css-values-3/vh-support-transform-translate.html css-values-3/all-green.html
-== css-values-3/vh-support.html css-values-3/all-green.html
-== css-values-3/vh-zero-support.html css-values-3/all-green.html
+== css-values-3/initial-background-color.html css-values-3/all-green-ref.html
+== css-values-3/vh-calc-support-pct.html css-values-3/all-green-ref.html
+== css-values-3/vh-calc-support.html css-values-3/all-green-ref.html
+== css-values-3/vh-em-inherit.html css-values-3/all-green-ref.html
+== css-values-3/vh-inherit.html css-values-3/all-green-ref.html
+== css-values-3/vh-interpolate-pct.html css-values-3/all-green-ref.html
+== css-values-3/vh-interpolate-px.html css-values-3/all-green-ref.html
+== css-values-3/vh-interpolate-vh.html css-values-3/all-green-ref.html
+== css-values-3/vh-support-atviewport.html css-values-3/all-green-ref.html
+== css-values-3/vh-support-margin.html css-values-3/all-green-ref.html
+skip == css-values-3/vh-support-transform-origin.html css-values-3/all-green-ref.html
+skip == css-values-3/vh-support-transform-translate.html css-values-3/all-green-ref.html
+== css-values-3/vh-support.html css-values-3/all-green-ref.html
+== css-values-3/vh-zero-support.html css-values-3/all-green-ref.html
skip == css-values-3/vh_not_refreshing_on_chrome.html css-values-3/vh_not_refreshing_on_chrome-ref.html
skip == css-values-3/vh_not_refreshing_on_chrome_iframe.html css-values-3/vh_not_refreshing_on_chrome-ref.html