Skip to content

Commit

Permalink
Fix flaky amp-ad-3p-impl preconnect test (ampproject#9011)
Browse files Browse the repository at this point in the history
* Fix flaky amp-ad-3p-impl preconnect test

* fix stupid sinon

* Fix babel-helper stub
  • Loading branch information
jridgewell authored and Eric Kenney committed May 3, 2017
1 parent 9afed66 commit acd61c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions extensions/amp-ad/0.1/test/test-amp-ad-3p-impl.js
Expand Up @@ -179,10 +179,8 @@ describe('amp-ad-3p-impl', () => {
});
});

// TODO(#8965) unskip test
describe('preconnectCallback', () => {
it.configure().skipOldChrome()
.run('should add preconnect and prefech to DOM header', () => {
it('should add preconnect and prefech to DOM header', () => {
ad3p.buildCallback();
ad3p.preconnectCallback();
return whenFirstVisible.then(() => {
Expand Down
11 changes: 5 additions & 6 deletions testing/test-helper.js
Expand Up @@ -18,13 +18,12 @@ import {xhrServiceForTesting} from '../src/service/xhr-impl';
import {getService, getServiceForDoc} from '../src/service';

export function stubService(sandbox, win, serviceId, method) {
const stub = sandbox.stub();
getService(win, serviceId, () => {
const service = {};
service[method] = stub;
return service;
const service = getService(win, serviceId, () => {
return {
[method]: () => {},
};
});
return stub;
return sandbox.stub(service, method);
}

export function stubServiceForDoc(sandbox, ampdoc, serviceId, method) {
Expand Down
1 change: 1 addition & 0 deletions third_party/babel/custom-babel-helpers.js
Expand Up @@ -92,5 +92,6 @@

babelHelpers.defineProperty = function(obj, key, value) {
obj[key] = value;
return obj;
};
})(typeof global === "undefined" ? self : global);

0 comments on commit acd61c5

Please sign in to comment.