diff --git a/karma-shared.conf.js b/karma-shared.conf.js
index 65774aa404e8..2a63ac4466be 100644
--- a/karma-shared.conf.js
+++ b/karma-shared.conf.js
@@ -45,12 +45,12 @@ module.exports = function(config, specificOptions) {
'SL_Chrome': {
base: 'SauceLabs',
browserName: 'chrome',
- version: '51'
+ version: '59'
},
'SL_Firefox': {
base: 'SauceLabs',
browserName: 'firefox',
- version: '47'
+ version: '54'
},
'SL_Safari_8': {
base: 'SauceLabs',
diff --git a/test/ng/directive/formSpec.js b/test/ng/directive/formSpec.js
index e1d681956b23..b48ff1084468 100644
--- a/test/ng/directive/formSpec.js
+++ b/test/ng/directive/formSpec.js
@@ -386,6 +386,9 @@ describe('form', function() {
doc = jqLite('
');
+ // Support: Chrome 60+ (on Windows)
+ // We need to add the form to the DOM in order for `submit` events to be properly fired.
+ window.document.body.appendChild(doc[0]);
var assertPreventDefaultListener = function(e) {
reloadPrevented = e.defaultPrevented || (e.returnValue === false);
@@ -420,15 +423,18 @@ describe('form', function() {
inject(function($timeout) {
doc = jqLite('' +
'' +
'
');
+ // Support: Chrome 60+ (on Windows)
+ // We need to add the form to the DOM in order for `submit` events to be properly fired.
+ window.document.body.appendChild(doc[0]);
var form = doc.find('form'),
destroyed = false,
nextTurn = false,
submitted = false,
- reloadPrevented;
+ reloadPrevented = 'never called';
scope.destroy = function() {
// yes, I know, scope methods should not do direct DOM manipulation, but I wanted to keep
@@ -466,6 +472,12 @@ describe('form', function() {
// the issue in the wild, I'm not going to bother to do it
// now. (i)
+ // Support: Chrome 60+ (on Windows)
+ // Chrome 60+ on Windows does not fire `submit` events when the form is not attached to
+ // the DOM. Verify that the `submit` listener was either never fired or (if fired) the
+ // reload was prevented.
+ expect(reloadPrevented).not.toBe(false);
+
// prevent mem leak in test
form[0].removeEventListener('submit', assertPreventDefaultListener);
})
diff --git a/test/ng/directive/ngEventDirsSpec.js b/test/ng/directive/ngEventDirsSpec.js
index d8288b828bbd..5555c592df6d 100644
--- a/test/ng/directive/ngEventDirsSpec.js
+++ b/test/ng/directive/ngEventDirsSpec.js
@@ -12,15 +12,20 @@ describe('event directives', function() {
describe('ngSubmit', function() {
it('should get called on form submit', inject(function($rootScope, $compile) {
- element = $compile('')($rootScope);
$rootScope.$digest();
+ // Support: Chrome 60+
+ // We need to add the form to the DOM in order for `submit` events to be properly fired.
+ window.document.body.appendChild(element[0]);
+
// prevent submit within the test harness
element.on('submit', function(e) { e.preventDefault(); });
- expect($rootScope.submitted).not.toBeDefined();
+ expect($rootScope.submitted).toBeUndefined();
browserTrigger(element.children()[0]);
expect($rootScope.submitted).toEqual(true);
@@ -33,15 +38,20 @@ describe('event directives', function() {
}
};
- element = $compile('')($rootScope);
$rootScope.$digest();
+ // Support: Chrome 60+ (on Windows)
+ // We need to add the form to the DOM in order for `submit` events to be properly fired.
+ window.document.body.appendChild(element[0]);
+
// prevent submit within the test harness
element.on('submit', function(e) { e.preventDefault(); });
- expect($rootScope.formSubmitted).not.toBeDefined();
+ expect($rootScope.formSubmitted).toBeUndefined();
browserTrigger(element.children()[0]);
expect($rootScope.formSubmitted).toEqual('foo');