Skip to content

Commit

Permalink
๐Ÿ—๐Ÿšฎ Remove all IE11 infrastructure code paths (ampproject#35341)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored Aug 26, 2021
1 parent 1e13253 commit 0b4682b
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 154 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/ie-tests.yml

This file was deleted.

4 changes: 0 additions & 4 deletions build-system/babel-config/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ function getReplaceGlobalsPlugin() {
return;
}
const possibleNames = ['globalThis', 'self'];
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility
if (argv.ie) {
possibleNames.shift();
}
const name = possibleNames.find((name) => !scope.getBinding(name));
if (!name) {
throw path.buildCodeFrameError(
Expand Down
35 changes: 0 additions & 35 deletions build-system/pr-check/ie-tests.js

This file was deleted.

1 change: 0 additions & 1 deletion build-system/tasks/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ integration.flags = {
'files': 'Run tests for specific files',
'grep': 'Run tests that match the pattern',
'headless': 'Run tests in a headless Chrome window',
'ie': 'Run tests on IE',
'nobuild': 'Skip build step',
'nohelp': 'Silence help messages that are printed prior to test run',
'report': 'Write test result report to a local file',
Expand Down
4 changes: 0 additions & 4 deletions build-system/tasks/runtime-test/custom-launchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ const customLaunchers = {
base: argv.headless ? 'EdgeBetaHeadless' : 'EdgeBeta',
flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
},
IECustom: {
base: 'IE',
flags: ['-extoff'],
},
};

module.exports = {
Expand Down
2 changes: 0 additions & 2 deletions build-system/tasks/runtime-test/runtime-test-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ class RuntimeTestConfig {
? 'EdgeCustom'
: argv.firefox
? 'FirefoxCustom'
: argv.ie
? 'IECustom'
: argv.safari
? 'SafariCustom'
: 'ChromeCustom';
Expand Down
1 change: 0 additions & 1 deletion build-system/tasks/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ unit.flags = {
'files': 'Run tests for specific files',
'grep': 'Run tests that match the pattern',
'headless': 'Run tests in a headless Chrome window',
'ie': 'Runs tests on IE',
'local_changes':
'Run unit tests directly affected by the files changed in the local branch',
'nohelp': 'Silence help messages that are printed prior to test run',
Expand Down
1 change: 0 additions & 1 deletion build-system/test-configs/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module.exports = {
'karma-firefox-launcher',
'karma-fixture',
'karma-html2js-preprocessor',
'karma-ie-launcher',
'karma-structured-json-reporter',
'karma-junit-reporter',
'karma-mocha',
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ To run the tests that are affected by the changes on your feature branch:
amp unit --local_changes
```
By default, all tests are run on Chrome. Pass one of the following flags to run tests on a different browser: `--firefox`, `--safari`, `--edge`, `--ie`.
By default, all tests are run on Chrome. Pass one of the following flags to run tests on a different browser: `--firefox`, `--safari`, `--edge`.
If you need help with fixing failing tests, please ask on the GitHub issue you're working on or reach out to the community as described in [How to get help](#how-to-get-help).
Expand Down
1 change: 0 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Before running these commands, make sure you have Node.js installed. For instruc
| `amp [unit\|integration] --safari` | Runs tests in Safari. |
| `amp [unit\|integration] --firefox` | Runs tests in Firefox. |
| `amp [unit\|integration] --edge` | Runs tests in Edge. |
| `amp [unit\|integration] --ie` | Runs tests in Internet Explorer. |
| `amp [unit\|integration] --files=<test-files-path-glob>` | Runs specific test files. |
| `amp [unit\|integration] --testnames` | Lists the name of each test being run, and prints a summary at the end. |
| `amp serve` | Serves content from the repository root at http://localhost:8000/. Examples live in http://localhost:8000/examples/. Serves unminified binaries by default. |
Expand Down
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
"karma-firefox-launcher": "2.1.1",
"karma-fixture": "0.2.6",
"karma-html2js-preprocessor": "1.1.0",
"karma-ie-launcher": "1.0.0",
"karma-junit-reporter": "2.0.1",
"karma-mocha": "2.0.1",
"karma-mocha-reporter": "2.2.5",
Expand Down
29 changes: 0 additions & 29 deletions test/fixtures/images-ie.html

This file was deleted.

2 changes: 1 addition & 1 deletion test/integration/builtins/test-amp-img.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {createFixtureIframe, expectBodyToBecomeVisible} from '#testing/iframe';

import {createCustomEvent} from '../../../src/event-helper';

describes.sandboxed.configure().run('Rendering of amp-img', {}, () => {
describes.sandboxed('Rendering of amp-img', {}, () => {
const timeout = window.ampTestRuntimeConfig.mochaTimeout;

let fixture;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test-amp-ad-doubleclick.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createFixtureIframe, poll, pollForLayout} from '#testing/iframe';

describes.sandboxed.configure().run('Rendering of one ad', {}, () => {
describes.sandboxed('Rendering of one ad', {}, () => {
let fixture;
let beforeHref;

Expand Down
68 changes: 34 additions & 34 deletions test/integration/test-shadow-dom-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,45 @@ import {toggleExperiment} from '#experiments';

import {createFixtureIframe} from '#testing/iframe';

describes.sandboxed
.configure()
.run('Render a shadow-dom based element', {}, () => {
let fixture;

beforeEach(async () => {
fixture = await createFixtureIframe(
'test/fixtures/shadow-dom-element.html',
3000
);
toggleExperiment(fixture.win, 'bento', true, true);
});
describes.sandboxed('Render a shadow-dom based element', {}, () => {
let fixture;

beforeEach(async () => {
fixture = await createFixtureIframe(
'test/fixtures/shadow-dom-element.html',
3000
);
toggleExperiment(fixture.win, 'bento', true, true);
});

it('should create shadow root', async () => {
const carousel = fixture.doc.querySelector('amp-base-carousel');
await whenUpgradedToCustomElement(carousel);
await carousel.whenBuilt();
await new Promise(setTimeout);
it('should create shadow root', async () => {
const carousel = fixture.doc.querySelector('amp-base-carousel');
await whenUpgradedToCustomElement(carousel);
await carousel.whenBuilt();
await new Promise(setTimeout);

expect(carousel.shadowRoot).to.exist;
expect(carousel.shadowRoot).to.exist;

const slides = carousel.querySelectorAll('amp-img');
expect(slides).to.have.length(2);
const slides = carousel.querySelectorAll('amp-img');
expect(slides).to.have.length(2);

const slots = carousel.shadowRoot
.querySelector('c')
.querySelectorAll('slot');
expect(slots).to.have.length(2);
const slots = carousel.shadowRoot
.querySelector('c')
.querySelectorAll('slot');
expect(slots).to.have.length(2);

expect(slides[0].assignedSlot).to.equal(slots[0]);
expect(slides[1].assignedSlot).to.equal(slots[1]);
expect(slots[0].assignedNodes()[0]).to.equal(slides[0]);
expect(slots[1].assignedNodes()[0]).to.equal(slides[1]);
expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot);
});
expect(slides[0].assignedSlot).to.equal(slots[0]);
expect(slides[1].assignedSlot).to.equal(slots[1]);
expect(slots[0].assignedNodes()[0]).to.equal(slides[0]);
expect(slots[1].assignedNodes()[0]).to.equal(slides[1]);
expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot);
});
});

describes.sandboxed
.configure()
.run('Render a shadow-dom based element, force polyfill', {}, () => {
describes.sandboxed(
'Render a shadow-dom based element, force polyfill',
{},
() => {
let fixture;

beforeEach(async () => {
Expand Down Expand Up @@ -76,4 +75,5 @@ describes.sandboxed
expect(slots[1].assignedNodes()[0]).to.equal(slides[1]);
expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot);
});
});
}
);
2 changes: 1 addition & 1 deletion test/integration/test-toggle-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {setInitialDisplay, toggle} from '#core/dom/style';

import {BrowserController} from '#testing/test-helper';

describes.integration.configure().run(
describes.integration(
'toggle display helper',
{
body: '<amp-img src="/examples/img/[email protected]" width="289" height="216"></amp-img>',
Expand Down
7 changes: 1 addition & 6 deletions testing/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Services} from '#service';
* using describes.configure(), describe.configure(), or it.configure().
*
* Example usage:
* 1. describes.configure().skipChrome().run(name, spec, function);
* 1. describes.configure().skipChrome().skipIos().run(name, spec, function);
* 2. describe.configure().skipFirefox().skipSafari().run(name, function);
* 3. it.configure().skipEdge().run(name, function);
*/
Expand Down Expand Up @@ -43,11 +43,6 @@ export class TestConfig {
this.runOnFirefox = this.platform.isFirefox.bind(this.platform);
this.runOnSafari = this.platform.isSafari.bind(this.platform);
this.runOnIos = this.platform.isIos.bind(this.platform);

/**
* By default, IE is skipped. Individual tests may opt in.
*/
this.skip(() => /Trident|MSIE|IEMobile/i.test(window.navigator.userAgent));
}

skipModuleBuild() {
Expand Down

0 comments on commit 0b4682b

Please sign in to comment.