Testing support for FF and Safari

Also travis support for testing FF.  See:

https://travis-ci.org/dart-lang/sdk/builds/159331789

On FF 48, 1965 out of 1979 tests are passing.  Run locally:
DDC_BROWSERS=Firefox npm test

On Safari 10 (tech preview), it fails immediately due to a static method named "caller".  We disallow it as a field, but not a method right now.  If I hack that out, 1972 out of 1979 tests appear to pass.

Run locally by installing tech preview and running:
DDC_BROWSERS=Safari SAFARI_BIN=/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/Safari\ Technology\ Preview npm test
R=jmesserly@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/2334763002 .
This commit is contained in:
Vijay Menon 2016-09-14 08:41:43 -07:00
parent 023295912a
commit 9732138317
9 changed files with 23 additions and 5 deletions

View file

@ -9,6 +9,8 @@ cache:
- $HOME/.nvm
- $HOME/.pub-cache/hosted
- pkg/dev_compiler/node_modules
addons:
firefox: latest
before_install:
# g++4.8.1 setup
- if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
@ -58,6 +60,7 @@ script:
- if [[ "$TEST" == node ]]; then ./tool/node_test.sh ; fi
env:
- ANALYZER=master
- ANALYZER=master DDC_BROWSERS=Firefox
- ANALYZER=master CXX=g++
- ANALYZER=master CXX=clang++
- TEST=coverage
@ -65,6 +68,7 @@ env:
matrix:
allow_failures:
- env: TEST=node
- env: ANALYZER=master DDC_BROWSERS=Firefox
- env: ANALYZER=master CXX=clang++
notifications:
email:

View file

@ -89,5 +89,9 @@ module.exports = function(config) {
configuration.client.captureConsole = true;
}
if (process.env.DDC_BROWSERS) {
configuration.browsers = process.env.DDC_BROWSERS.split(':');
}
config.set(configuration);
};

View file

@ -1021,6 +1021,7 @@ define([], function() {
if (!jsType) return;
let extProto = dartExtType.prototype;
let jsProto = jsType.prototype;
if (!jsProto) return;
jsProto[dart._extensionType] = dartExtType;
dart._installProperties(jsProto, extProto);
let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, dart._methodSig).get;
@ -1761,7 +1762,7 @@ define([], function() {
};
dart.nullSafe = function(obj, ...callbacks) {
if (obj == null) return obj;
for (const callback of callbacks) {
for (let callback of callbacks) {
obj = callback(obj);
if (obj == null) break;
}

View file

@ -1021,6 +1021,7 @@
if (!jsType) return;
let extProto = dartExtType.prototype;
let jsProto = jsType.prototype;
if (!jsProto) return;
jsProto[dart._extensionType] = dartExtType;
dart._installProperties(jsProto, extProto);
let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, dart._methodSig).get;
@ -1761,7 +1762,7 @@
};
dart.nullSafe = function(obj, ...callbacks) {
if (obj == null) return obj;
for (const callback of callbacks) {
for (let callback of callbacks) {
obj = callback(obj);
if (obj == null) break;
}

View file

@ -1019,6 +1019,7 @@ dart.registerExtension = function(jsType, dartExtType) {
if (!jsType) return;
let extProto = dartExtType.prototype;
let jsProto = jsType.prototype;
if (!jsProto) return;
jsProto[dart._extensionType] = dartExtType;
dart._installProperties(jsProto, extProto);
let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, dart._methodSig).get;
@ -1759,7 +1760,7 @@ dart.stackTrace = function(exception) {
};
dart.nullSafe = function(obj, ...callbacks) {
if (obj == null) return obj;
for (const callback of callbacks) {
for (let callback of callbacks) {
obj = callback(obj);
if (obj == null) break;
}

View file

@ -1022,6 +1022,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
if (!jsType) return;
let extProto = dartExtType.prototype;
let jsProto = jsType.prototype;
if (!jsProto) return;
jsProto[dart._extensionType] = dartExtType;
dart._installProperties(jsProto, extProto);
let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, dart._methodSig).get;
@ -1762,7 +1763,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
};
dart.nullSafe = function(obj, ...callbacks) {
if (obj == null) return obj;
for (const callback of callbacks) {
for (let callback of callbacks) {
obj = callback(obj);
if (obj == null) break;
}

View file

@ -22,8 +22,10 @@
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^0.1.8",
"karma-electron-launcher": "^0.0.5",
"karma-firefox-launcher": "~0.1",
"karma-mocha": "^0.1.10",
"karma-requirejs": "^0.2.2",
"karma-safari-launcher": "^1.0.0",
"mocha": "^2.2.4",
"requirejs": "^2.1.17",
"webdriver-manager": "8.0.0"

View file

@ -422,6 +422,10 @@ registerExtension(jsType, dartExtType) => JS(
let extProto = $dartExtType.prototype;
let jsProto = $jsType.prototype;
// TODO(vsm): This sometimes doesn't exist on FF. These types will be
// broken.
if (!jsProto) return;
// Mark the JS type's instances so we can easily check for extensions.
jsProto[$_extensionType] = $dartExtType;
$_installProperties(jsProto, extProto);

View file

@ -509,7 +509,7 @@ stackTrace(exception) => JS('', '''(() => {
///
nullSafe(obj, @rest callbacks) => JS('', '''(() => {
if ($obj == null) return $obj;
for (const callback of $callbacks) {
for (let callback of $callbacks) {
$obj = callback($obj);
if ($obj == null) break;
}