Index: third_party/WebKit/LayoutTests/resources/testharnessreport.js |
diff --git a/third_party/WebKit/LayoutTests/resources/testharnessreport.js b/third_party/WebKit/LayoutTests/resources/testharnessreport.js |
index 64c08a922e7b4a1fa004960fd22c6aeeb80ac7b3..0dba6f206509b4ec011452b8b5f3a6cfddc03b87 100644 |
--- a/third_party/WebKit/LayoutTests/resources/testharnessreport.js |
+++ b/third_party/WebKit/LayoutTests/resources/testharnessreport.js |
@@ -66,9 +66,19 @@ |
return !!document.querySelector('script[src*="/resources/testharness"]'); |
} |
+ |
function injectSyntheticInput() { |
var path = window.location.pathname; |
if (path.match(/imported\/wpt\/.*\.html$/)) { |
+ // Set a global variable for the address of automated input script if they need to use it. |
+ var automated_input_scripts_folder = path.replace(/imported\/wpt\/(.*)\.html$/, 'imported/wpt_automation'); |
+ |
+ importAutomationScript = function(relativePath) { |
+ var common_script = document.createElement('script'); |
+ common_script.setAttribute('src', automated_input_scripts_folder + relativePath); |
+ document.head.appendChild(common_script); |
+ } |
+ |
path = path.replace(/imported\/wpt\/(.*)\.html$/, "imported/wpt_automation/$1-input.js"); |
var input_script = document.createElement('script'); |
input_script.setAttribute('src', path); |