Skip to content

Commit

Permalink
Fix Firefox tests, add it to travis.yml
Browse files Browse the repository at this point in the history
1. Don't use PointerEvents for tests in Firefox, see #6539.  This makes
all tests but one pass.

2. Run built files against FirefhoxHeadless. This means we run unminified
on Chrome and minified on Firefox.  This helps keep the build time down
by not running everything twice on both browsers, but will still catch
Firefox-specific bugs that we can then run locally.
  • Loading branch information
mramato committed Aug 3, 2018
1 parent c59efc9 commit fff806f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_js:
sudo: false
addons:
chrome: stable
firefox: latest
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -19,7 +20,7 @@ script:

- echo 'test webgl-stub' && echo -en 'travis_fold:start:script.test\\r'
- npm run build
- npm run test -- --browsers ChromeCI --webgl-stub --failTaskOnError --suppressPassed
- npm run test -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed
- echo -en 'travis_fold:end:script.test\\r'

- echo 'makeZipFile' && echo -en 'travis_fold:start:script.makeZipFile\\r'
Expand All @@ -38,7 +39,7 @@ script:
- echo -en 'travis_fold:end:script.deploy\\r'

- echo 'test webgl-stub release' && echo -en 'travis_fold:start:script test.release\\r'
- npm run test -- --browsers ChromeCI --failTaskOnError --webgl-stub --release --suppressPassed
- npm run test -- --browsers FirefoxHeadless --failTaskOnError --webgl-stub --release --suppressPassed
- echo -en 'travis_fold:end:script test.release\\r'

- echo 'test node' && echo -en 'travis_fold:start:script test.node\\r'
Expand Down
12 changes: 11 additions & 1 deletion Specs/Core/ScreenSpaceEventHandlerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defineSuite([
DomEventSimulator) {
'use strict';

var usePointerEvents = FeatureDetection.supportsPointerEvents();
var usePointerEvents;
var element;
var handler;

Expand Down Expand Up @@ -63,6 +63,16 @@ defineSuite([
event.preventDefault();
}

beforeAll(function(){
usePointerEvents = FeatureDetection.supportsPointerEvents();

//See https://github.com/AnalyticalGraphicsInc/cesium/issues/6539
if (FeatureDetection.isFirefox()) {
usePointerEvents = false;
spyOn(FeatureDetection, 'supportsPointerEvents').and.returnValue(false);
}
});

beforeEach(function() {
// ignore events that bubble up to the document.
// this prevents triggering the browser's "middle click to scroll" behavior
Expand Down
9 changes: 8 additions & 1 deletion Specs/Scene/CameraEventAggregatorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ defineSuite([
DomEventSimulator) {
'use strict';

var usePointerEvents = FeatureDetection.supportsPointerEvents();
var usePointerEvents;
var canvas;
var handler;
var handler2;

beforeAll(function() {
usePointerEvents = FeatureDetection.supportsPointerEvents();

//See https://github.com/AnalyticalGraphicsInc/cesium/issues/6539
if (FeatureDetection.isFirefox()) {
usePointerEvents = false;
spyOn(FeatureDetection, 'supportsPointerEvents').and.returnValue(false);
}
canvas = createCanvas(1024, 768);
});

Expand Down
9 changes: 8 additions & 1 deletion Specs/Scene/ScreenSpaceCameraControllerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defineSuite([
DomEventSimulator) {
'use strict';

var usePointerEvents = FeatureDetection.supportsPointerEvents();
var usePointerEvents;
var scene;
var canvas;
var camera;
Expand Down Expand Up @@ -80,6 +80,13 @@ defineSuite([
};
}
beforeAll(function() {
usePointerEvents = FeatureDetection.supportsPointerEvents();

//See https://github.com/AnalyticalGraphicsInc/cesium/issues/6539
if (FeatureDetection.isFirefox()) {
usePointerEvents = false;
spyOn(FeatureDetection, 'supportsPointerEvents').and.returnValue(false);
}
canvas = createCanvas(1024, 768);
});

Expand Down

0 comments on commit fff806f

Please sign in to comment.