зеркало из https://github.com/mozilla/gecko-dev.git
bug 420084 - reftest should use nsIXULRuntime.widgetToolkit instead of autoconf.js. r=dbaron
This commit is contained in:
Родитель
de4b1fdca9
Коммит
ab3cd011df
|
@ -40,6 +40,11 @@ HTTP(..) == filter-2.xhtml filter-2-ref.xhtml
|
|||
== invalidation.html about:blank
|
||||
== zoom-invalidation.html zoom-invalidation-ref.html
|
||||
|
||||
# test that xulRuntime.OS works
|
||||
fails-if(xulRuntime.OS!="Linux") == data:text/html,<body>Linux data:text/html,<script>document.write(navigator.platform.substr(0,5))</script>
|
||||
fails-if(xulRuntime.OS!="WINNT") == data:text/html,<body>Win32 data:text/html,<script>document.write(navigator.platform)</script>
|
||||
fails-if(xulRuntime.OS!="Darwin") == data:text/html,<body>Mac data:text/html,<script>document.write(navigator.platform.substr(0,3))</script>
|
||||
|
||||
# test parsing of asserts() expressions
|
||||
asserts(0) load about:blank
|
||||
asserts(0-5) load about:blank
|
||||
|
|
|
@ -48,20 +48,4 @@ EXTRA_COMPONENTS= \
|
|||
reftest-cmdline.js \
|
||||
$(NULL)
|
||||
|
||||
CHROME_DEPS = \
|
||||
autoconf.js \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
autoconf.js: $(DEPTH)/config/autoconf.mk Makefile
|
||||
echo 'var gAutoconfVars = {' > $@
|
||||
# strip comments, escape \ and ", use only assignment lines that
|
||||
# don't end in backslashes and don't have variables, and then
|
||||
# convert to JS properties
|
||||
cat $< | egrep -v "^export " | perl -p -e 's/#.*//;s,\\,\\\\,g;s,",\\",g' | grep '=' | grep -v '\\$$' | grep -v '\$$' | perl -p -e 's/[ \t]*:?= *(.*)/: "\1",/' >> $@
|
||||
echo 'dummy_var: null' >> $@ # to avoid trailing comma
|
||||
echo '};' >> $@
|
||||
|
||||
ALL_TRASH += autoconf.js
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
reftest.jar:
|
||||
% content reftest %content/
|
||||
content/autoconf.js (autoconf.js)
|
||||
* content/quit.js (quit.js)
|
||||
* content/reftest.js (reftest.js)
|
||||
content/reftest.xul (reftest.xul)
|
||||
|
|
|
@ -53,6 +53,9 @@ const NS_REFTESTHELPER_CONTRACTID =
|
|||
"@mozilla.org/reftest-helper;1";
|
||||
const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX =
|
||||
"@mozilla.org/network/protocol;1?name=";
|
||||
const NS_XREAPPINFO_CONTRACTID =
|
||||
"@mozilla.org/xre/app-info;1";
|
||||
|
||||
|
||||
const LOAD_FAILURE_TIMEOUT = 10000; // ms
|
||||
|
||||
|
@ -200,8 +203,11 @@ function ReadManifest(aURL)
|
|||
|
||||
// Build the sandbox for fails-if(), etc., condition evaluation.
|
||||
var sandbox = new Components.utils.Sandbox(aURL.spec);
|
||||
for (var prop in gAutoconfVars)
|
||||
sandbox[prop] = gAutoconfVars[prop];
|
||||
var xr = CC[NS_XREAPPINFO_CONTRACTID].getService(CI.nsIXULRuntime);
|
||||
sandbox.MOZ_WIDGET_TOOLKIT = xr.widgetToolkit;
|
||||
sandbox.xulRuntime = {widgetToolkit: xr.widgetToolkit,
|
||||
OS: xr.OS,
|
||||
XPCOMABI: xr.XPCOMABI};
|
||||
var hh = CC[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].
|
||||
getService(CI.nsIHttpProtocolHandler);
|
||||
sandbox.http = {};
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
style="background:white"
|
||||
>
|
||||
<script type="application/ecmascript" src="quit.js" />
|
||||
<script type="application/ecmascript" src="autoconf.js" />
|
||||
<script type="application/ecmascript" src="reftest.js" />
|
||||
<browser id="browser" flex="1" type="content-primary" style="width: 800px; height: 1000px" />
|
||||
</window>
|
||||
|
|
Загрузка…
Ссылка в новой задаче