Skip to content

Commit 1da3850

Browse files
committed
Update GeneratedJsTestServlet to work with test files that use Closure's
module syntax.
1 parent 98f802a commit 1da3850

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

java/client/test/org/openqa/selenium/environment/webserver/GeneratedJsTestServlet.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
4545
+ "<script src=\"/third_party/closure/goog/base.js\"></script>\n"
4646
+ "<script src=\"/javascript/deps.js\"></script>\n"
4747
+ "<script>\n"
48-
+ " goog.addDependency('../../.." + req.getPathInfo() + "',\n"
49-
+ " ['" + symbol + "'],\n"
50-
+ " goog.dependencies_.requires['../../.." + req.getPathInfo() + "'] || []);\n"
51-
+ " goog.require('" + symbol + "');\n"
48+
+ " (function() {\n"
49+
+ " var path = '../../.." + req.getPathInfo() + "';\n"
50+
+ " goog.addDependency(path, ['" + symbol + "'],\n"
51+
+ " goog.dependencies_.requires['../../.." + req.getPathInfo() + "'] || [],\n"
52+
+ " !!goog.dependencies_.pathIsModule[path]);\n"
53+
+ " goog.require('" + symbol + "');\n"
54+
+ " })()\n"
5255
+ "</script></head><body></body></html>").getBytes(Charsets.UTF_8);
5356

5457
resp.setStatus(HttpServletResponse.SC_OK);

0 commit comments

Comments
 (0)