Backed out changeset 266931d06efb (bug 1558756) for causing devtools failures CLOSED TREE

This commit is contained in:
Mihai Alexandru Michis 2019-07-23 17:49:45 +03:00
Родитель b7588f8d35
Коммит bae6d95085
14 изменённых файлов: 24 добавлений и 728 удалений

Просмотреть файл

@ -1,337 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`App: renders the expected snapshot for an App with empty worker list 1`] = `
<Provider
store={
Object {
"dispatch": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<LocalizationProvider
messages={Array []}
>
<Connect(App)
canDebugWorkers={true}
domain="domain"
fluentBundles={Array []}
serviceContainer={Object {}}
>
<App
canDebugWorkers={false}
dispatch={[Function]}
domain={null}
fluentBundles={Array []}
serviceContainer={Object {}}
workers={Array []}
>
<LocalizationProvider
messages={Array []}
>
<main
className="application application--empty"
>
<WorkerListEmpty
serviceContainer={Object {}}
>
<article
className="worker-list-empty js-worker-list-empty"
>
<Localized
a={
<a
className="external-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-intro"
>
<p
className="worker-list-empty__title"
/>
</Localized>
<Localized
id="serviceworker-empty-suggestions"
>
<p />
</Localized>
<ul
className="worker-list-empty__tips"
>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-console"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-debugger"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link js-trusted-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-aboutdebugging"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
</ul>
</article>
</WorkerListEmpty>
</main>
</LocalizationProvider>
</App>
</Connect(App)>
</LocalizationProvider>
</Provider>
`;
exports[`App: renders the expected snapshot for an App with multiple workers list 1`] = `
<Provider
store={
Object {
"dispatch": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<LocalizationProvider
messages={Array []}
>
<Connect(App)
canDebugWorkers={true}
domain="domain"
fluentBundles={Array []}
serviceContainer={Object {}}
>
<App
canDebugWorkers={false}
dispatch={[Function]}
domain={null}
fluentBundles={Array []}
serviceContainer={Object {}}
workers={Array []}
>
<LocalizationProvider
messages={Array []}
>
<main
className="application application--empty"
>
<WorkerListEmpty
serviceContainer={Object {}}
>
<article
className="worker-list-empty js-worker-list-empty"
>
<Localized
a={
<a
className="external-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-intro"
>
<p
className="worker-list-empty__title"
/>
</Localized>
<Localized
id="serviceworker-empty-suggestions"
>
<p />
</Localized>
<ul
className="worker-list-empty__tips"
>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-console"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-debugger"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link js-trusted-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-aboutdebugging"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
</ul>
</article>
</WorkerListEmpty>
</main>
</LocalizationProvider>
</App>
</Connect(App)>
</LocalizationProvider>
</Provider>
`;
exports[`App: renders the expected snapshot for an App with single worker list 1`] = `
<Provider
store={
Object {
"dispatch": [Function],
"getState": [Function],
"replaceReducer": [Function],
"subscribe": [Function],
Symbol(observable): [Function],
}
}
>
<LocalizationProvider
messages={Array []}
>
<Connect(App)
canDebugWorkers={true}
domain="domain"
fluentBundles={Array []}
serviceContainer={Object {}}
>
<App
canDebugWorkers={false}
dispatch={[Function]}
domain={null}
fluentBundles={Array []}
serviceContainer={Object {}}
workers={Array []}
>
<LocalizationProvider
messages={Array []}
>
<main
className="application application--empty"
>
<WorkerListEmpty
serviceContainer={Object {}}
>
<article
className="worker-list-empty js-worker-list-empty"
>
<Localized
a={
<a
className="external-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-intro"
>
<p
className="worker-list-empty__title"
/>
</Localized>
<Localized
id="serviceworker-empty-suggestions"
>
<p />
</Localized>
<ul
className="worker-list-empty__tips"
>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-console"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-debugger"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
<Localized
a={
<a
className="link js-trusted-link"
onClick={[Function]}
/>
}
id="serviceworker-empty-suggestions-aboutdebugging"
>
<li
className="worker-list-empty__tips__item"
/>
</Localized>
</ul>
</article>
</WorkerListEmpty>
</main>
</LocalizationProvider>
</App>
</Connect(App)>
</LocalizationProvider>
</Provider>
`;

Просмотреть файл

@ -1,111 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Service Worker List: renders the expected snapshot for a workerList with multiple workers list 1`] = `
Array [
<article
className="workers-container"
>
<Localized
id="serviceworker-list-header"
>
<h1
className="application--title"
/>
</Localized>
<ul>
<Worker
client={Object {}}
worker={
Object {
"active": true,
"name": "worker1",
"registrationFront": "",
"scope": "SCOPE 123",
"workerTargetFront": "",
}
}
/>
<Worker
client={Object {}}
worker={
Object {
"active": false,
"name": "worker2",
"registrationFront": "",
"scope": "SCOPE 456",
"workerTargetFront": "",
}
}
/>
<Worker
client={Object {}}
worker={
Object {
"active": true,
"name": "worker3",
"registrationFront": "",
"scope": "SCOPE 789",
"workerTargetFront": "",
}
}
/>
</ul>
</article>,
<Localized
a={
<a
className="aboutdebugging-plug__link"
onClick={[Function]}
/>
}
id="serviceworker-list-aboutdebugging"
>
<footer
className="aboutdebugging-plug"
/>
</Localized>,
]
`;
exports[`Service Worker List: renders the expected snapshot for a workerList with single worker list 1`] = `
Array [
<article
className="workers-container"
>
<Localized
id="serviceworker-list-header"
>
<h1
className="application--title"
/>
</Localized>
<ul>
<Worker
client={Object {}}
worker={
Object {
"active": true,
"name": "worker1",
"registrationFront": "",
"scope": "SCOPE 123",
"workerTargetFront": "",
}
}
/>
</ul>
</article>,
<Localized
a={
<a
className="aboutdebugging-plug__link"
onClick={[Function]}
/>
}
id="serviceworker-list-aboutdebugging"
>
<footer
className="aboutdebugging-plug"
/>
</Localized>,
]
`;

Просмотреть файл

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Empty Service Worker List: renders the expected snapshot for a workerListEmpty with empty worker list 1`] = `
exports[`Dummy test shallow renders a component 1`] = `
<article
className="worker-list-empty js-worker-list-empty"
>
@ -13,7 +13,7 @@ exports[`Empty Service Worker List: renders the expected snapshot for a workerLi
}
id="serviceworker-empty-intro"
>
<p
<h1
className="worker-list-empty__title"
/>
</Localized>

Просмотреть файл

@ -1,82 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Import libs
const { mount } = require("enzyme");
const React = require("react");
const Provider = React.createFactory(
require("devtools/client/shared/vendor/react-redux").Provider
);
// Import & init localization
const FluentReact = require("devtools/client/shared/vendor/fluent-react");
const LocalizationProvider = React.createFactory(
FluentReact.LocalizationProvider
);
// Import constants
const {
INITSTATE,
CLIENT,
EMPTY_WORKER_LIST,
SINGLE_WORKER_LIST,
MULTIPLE_WORKER_LIST,
} = require("devtools/client/application/test/components/fixtures/data/constants");
// Import setupStore with imported & combined reducers
const {
setupStore,
} = require("devtools/client/application/test/components/helpers/helpers");
// Import component
const App = React.createFactory(
require("devtools/client/application/src/components/App")
);
/**
* Test for App.js component
*/
describe("App:", () => {
const store = setupStore(INITSTATE, {
client: CLIENT,
worker: SINGLE_WORKER_LIST,
});
it("renders the expected snapshot for an App with empty worker list", () => {
const wrapper = mount(
Provider(
{ store },
LocalizationProvider(
{ messages: [] },
App(INITSTATE, { client: CLIENT, worker: EMPTY_WORKER_LIST })
)
)
);
expect(wrapper).toMatchSnapshot();
});
it("renders the expected snapshot for an App with single worker list", () => {
const wrapper = mount(
Provider(
{ store },
LocalizationProvider(
{ messages: [] },
App(INITSTATE, { client: CLIENT, worker: SINGLE_WORKER_LIST })
)
)
);
expect(wrapper).toMatchSnapshot();
});
it("renders the expected snapshot for an App with multiple workers list", () => {
const wrapper = mount(
Provider(
{ store },
LocalizationProvider(
{ messages: [] },
App(INITSTATE, { client: CLIENT, worker: MULTIPLE_WORKER_LIST })
)
)
);
expect(wrapper).toMatchSnapshot();
});
});

Просмотреть файл

@ -1,46 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Import libs
const { shallow } = require("enzyme");
const React = require("react");
// Import constants
const {
CLIENT,
SINGLE_WORKER_LIST,
MULTIPLE_WORKER_LIST,
} = require("devtools/client/application/test/components/fixtures/data/constants");
const WorkerList = React.createFactory(
require("devtools/client/application/src/components/WorkerList")
);
/**
* Test for workerList.js component
*/
describe("Service Worker List:", () => {
it("renders the expected snapshot for a workerList with single worker list", () => {
const wrapper = shallow(
WorkerList({
client: CLIENT,
workers: SINGLE_WORKER_LIST,
isDebugEnabled: true,
})
);
expect(wrapper).toMatchSnapshot();
});
it("renders the expected snapshot for a workerList with multiple workers list", () => {
const wrapper = shallow(
WorkerList({
client: CLIENT,
workers: MULTIPLE_WORKER_LIST,
isDebugEnabled: true,
})
);
expect(wrapper).toMatchSnapshot();
});
});

Просмотреть файл

@ -1,35 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Import libs
const { shallow } = require("enzyme");
const React = require("react");
// Import constants
const {
CLIENT,
EMPTY_WORKER_LIST,
} = require("devtools/client/application/test/components/fixtures/data/constants");
const WorkerListEmpty = React.createFactory(
require("devtools/client/application/src/components/WorkerListEmpty")
);
/**
* Test for workerListEmpty.js component
*/
describe("Empty Service Worker List:", () => {
it("renders the expected snapshot for a workerListEmpty with empty worker list", () => {
const wrapper = shallow(
WorkerListEmpty({
client: CLIENT,
workers: EMPTY_WORKER_LIST,
isDebugEnabled: true,
})
);
expect(wrapper).toMatchSnapshot();
});
});

Просмотреть файл

@ -0,0 +1,22 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* eslint-env jest */
const { shallow } = require("enzyme");
const React = require("react");
const WorkerListEmpty = require("devtools/client/application/src/components/WorkerListEmpty");
const WorkerListEmptyComp = React.createFactory(WorkerListEmpty);
/**
* Dummy test to check if setup is working + we render one component
*/
describe("Dummy test", () => {
it("shallow renders a component", () => {
const wrapper = shallow(WorkerListEmptyComp({}));
expect(wrapper).toMatchSnapshot();
});
});

Просмотреть файл

@ -1,56 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const INITSTATE = {
domain: "domain",
fluentBundles: [],
serviceContainer: {},
canDebugWorkers: true,
};
const CLIENT = {};
const EMPTY_WORKER_LIST = [];
const SINGLE_WORKER_LIST = [
{
active: true,
name: "worker1",
scope: "SCOPE 123",
registrationFront: "",
workerTargetFront: "",
},
];
const MULTIPLE_WORKER_LIST = [
{
active: true,
name: "worker1",
scope: "SCOPE 123",
registrationFront: "",
workerTargetFront: "",
},
{
active: false,
name: "worker2",
scope: "SCOPE 456",
registrationFront: "",
workerTargetFront: "",
},
{
active: true,
name: "worker3",
scope: "SCOPE 789",
registrationFront: "",
workerTargetFront: "",
},
];
module.exports = {
INITSTATE,
CLIENT,
EMPTY_WORKER_LIST,
SINGLE_WORKER_LIST,
MULTIPLE_WORKER_LIST,
};

Просмотреть файл

@ -1,12 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.exports = {
// Identity methods for all APIs from unicode-url.
getUnicodeHostname: arg => arg,
getUnicodeUrl: arg => arg,
getUnicodeUrlPath: arg => arg,
};

Просмотреть файл

@ -1,16 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const {
workersReducer,
} = require("devtools/client/application/src/reducers/workers-state");
const {
pageReducer,
} = require("devtools/client/application/src/reducers/page-state");
exports.reducers = {
workers: workersReducer,
page: pageReducer,
};

Просмотреть файл

@ -1,25 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const {
reducers,
} = require("devtools/client/application/test/components/helpers/helper-reducer");
const {
createStore,
combineReducers,
} = require("devtools/client/shared/vendor/redux");
/**
* Prepare the store for use in testing.
*/
function setupStore({ preloadedState } = {}) {
const store = createStore(combineReducers(reducers), preloadedState);
return store;
}
module.exports = {
setupStore,
};

Просмотреть файл

@ -14,7 +14,6 @@ module.exports = {
"^devtools/shared/plural-form": `${__dirname}/fixtures/plural-form`,
"^chrome": `${__dirname}/fixtures/Chrome`,
"^Services": `${__dirname}/fixtures/Services`,
"^devtools/client/shared/unicode-url": `${__dirname}/fixtures/unicode-url`,
// Map all require("devtools/...") to the real devtools root.
"^devtools\\/(.*)": `${__dirname}/../../../../$1`,
},

Просмотреть файл

@ -33,10 +33,6 @@ const SUITES = {
path: "../accessibility/test/jest",
type: TEST_TYPES.JEST,
},
application: {
path: "../application/test/components",
type: TEST_TYPES.JEST,
},
framework: {
path: "../framework/test/jest",
type: TEST_TYPES.JEST,

Просмотреть файл

@ -46,7 +46,6 @@ devtools-tests:
cd /builds/worker/checkouts/gecko/devtools/client/bin/ &&
node devtools-node-test-runner.js --suite=aboutdebugging-new &&
node devtools-node-test-runner.js --suite=accessibility &&
node devtools-node-test-runner.js --suite=application &&
node devtools-node-test-runner.js --suite=framework &&
node devtools-node-test-runner.js --suite=netmonitor &&
node devtools-node-test-runner.js --suite=webconsole