Skip to content

Commit

Permalink
fastpass fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-beard committed Mar 31, 2020
1 parent 2860a4c commit eba86b2
Show file tree
Hide file tree
Showing 28 changed files with 134 additions and 60 deletions.
28 changes: 14 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const targets = require('./targets.config');
const merge = require('lodash/merge');
const yaml = require('js-yaml');

module.exports = function (grunt) {
module.exports = function(grunt) {
const extensionPath = 'extension';

const packageReportPath = path.join('package', 'report');
Expand Down Expand Up @@ -351,7 +351,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-sass');

grunt.registerMultiTask('embed-styles', function () {
grunt.registerMultiTask('embed-styles', function() {
const { cssPath } = this.data;
this.files.forEach(file => {
const {
Expand All @@ -373,7 +373,7 @@ module.exports = function (grunt) {
});
});

grunt.registerMultiTask('configure', function () {
grunt.registerMultiTask('configure', function() {
const { config, configJSONPath, configJSPath, telemetryKeyIdentifier } = this.data;
// We pass this as an option from a build variable not because it is a secret
// (it can be found easily enough from released builds), but to make it harder
Expand All @@ -390,7 +390,7 @@ module.exports = function (grunt) {
grunt.file.write(configJSPath, configJS);
});

grunt.registerMultiTask('manifest', function () {
grunt.registerMultiTask('manifest', function() {
const { config, manifestSrc, manifestDest } = this.data;
const manifestJSON = grunt.file.readJSON(manifestSrc);
merge(manifestJSON, {
Expand All @@ -411,7 +411,7 @@ module.exports = function (grunt) {
grunt.file.write(manifestDest, JSON.stringify(manifestJSON, undefined, 2));
});

grunt.registerMultiTask('drop', function () {
grunt.registerMultiTask('drop', function() {
const targetName = this.target;
const { bundleFolder, mustExistFile, config } = targets[targetName];

Expand All @@ -432,7 +432,7 @@ module.exports = function (grunt) {
console.log(`${targetName} extension is in ${dropExtensionPath}`);
});

grunt.registerMultiTask('configure-electron-builder', function () {
grunt.registerMultiTask('configure-electron-builder', function() {
grunt.task.requires('drop:' + this.target);
const { dropPath, electronIconBaseName, fullName, appId, publishUrl } = this.data;

Expand Down Expand Up @@ -466,7 +466,7 @@ module.exports = function (grunt) {
grunt.log.writeln(`generated ${outElectronBuilderConfigFile} from target config`);
});

grunt.registerMultiTask('electron-builder-pack', function () {
grunt.registerMultiTask('electron-builder-pack', function() {
grunt.task.requires('drop:' + this.target);
grunt.task.requires('configure-electron-builder:' + this.target);

Expand Down Expand Up @@ -499,7 +499,7 @@ module.exports = function (grunt) {
);
});

grunt.registerMultiTask('zip-mac-folder', function () {
grunt.registerMultiTask('zip-mac-folder', function() {
grunt.task.requires('drop:' + this.target);
grunt.task.requires('configure-electron-builder:' + this.target);
grunt.task.requires('electron-builder-pack:' + this.target);
Expand Down Expand Up @@ -537,14 +537,14 @@ module.exports = function (grunt) {
);
});

grunt.registerMultiTask('unified-release-drop', function () {
grunt.registerMultiTask('unified-release-drop', function() {
grunt.task.run(`drop:${this.target}`);
grunt.task.run(`configure-electron-builder:${this.target}`);
grunt.task.run(`electron-builder-pack:${this.target}`);
grunt.task.run(`zip-mac-folder:${this.target}`);
});

grunt.registerTask('package-report', function () {
grunt.registerTask('package-report', function() {
const mustExistPath = path.join(packageReportBundlePath, 'report.bundle.js');

mustExist(mustExistPath, 'Have you run webpack?');
Expand All @@ -555,7 +555,7 @@ module.exports = function (grunt) {
console.log(`package is in ${packageReportDropPath}`);
});

grunt.registerTask('package-ui', function () {
grunt.registerTask('package-ui', function() {
const mustExistPath = path.join(packageUIBundlePath, 'ui.bundle.js');

mustExist(mustExistPath, 'Have you run webpack?');
Expand All @@ -565,19 +565,19 @@ module.exports = function (grunt) {
console.log(`package is in ${packageUIDropPath}`);
});

grunt.registerTask('extension-release-drops', function () {
grunt.registerTask('extension-release-drops', function() {
extensionReleaseTargets.forEach(targetName => {
grunt.task.run('drop:' + targetName);
});
});

grunt.registerTask('unified-release-drops', function () {
grunt.registerTask('unified-release-drops', function() {
unifiedReleaseTargets.forEach(targetName => {
grunt.task.run('unified-release-drop:' + targetName);
});
});

grunt.registerTask('ada-cat', function () {
grunt.registerTask('ada-cat', function() {
if (process.env.SHOW_ADA !== 'false') {
console.log(
'Image of Ada sleeping follows. Set environment variable SHOW_ADA to false to hide.',
Expand Down
11 changes: 5 additions & 6 deletions deploy/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
module.exports = function (grunt) {
module.exports = function(grunt) {
const webStoreAccount = {
client_id: grunt.option('webstore-client-id'),
client_secret: grunt.option('webstore-client-secret'),
Expand Down Expand Up @@ -59,12 +59,11 @@ module.exports = function (grunt) {

const makeVersionFromDateString = lastSeperator => {
const now = new Date();
return `${now.getUTCFullYear()}.${
now.getUTCMonth() + 1
}.${now.getUTCDate()}${lastSeperator}${now.getUTCHours() * 100 + now.getUTCMinutes()}`;
return `${now.getUTCFullYear()}.${now.getUTCMonth() +
1}.${now.getUTCDate()}${lastSeperator}${now.getUTCHours() * 100 + now.getUTCMinutes()}`;
};

grunt.registerTask('update-config', function () {
grunt.registerTask('update-config', function() {
const configJSONPath = 'product/insights.config.json';
const config = grunt.file.readJSON(configJSONPath);

Expand All @@ -80,7 +79,7 @@ module.exports = function (grunt) {
grunt.file.write(configJSPath, configJS);
});

grunt.registerTask('update-manifest', function () {
grunt.registerTask('update-manifest', function() {
const manifestPath = 'product/manifest.json';
const manifest = grunt.file.readJSON(manifestPath);
let version = options.extensionVersion;
Expand Down
2 changes: 1 addition & 1 deletion pipeline/scripts/download-electron-mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ download(
version: pkg.devDependencies.electron,
cache: 'drop/zips',
},
function (err, zipPath) {
function(err, zipPath) {
// zipPath will be the path of the zip that it downloaded.
// If the zip was already cached it will skip
// downloading and call the cb with the cached zip path.
Expand Down
4 changes: 3 additions & 1 deletion src/common/get-inner-text-from-jsx-element.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
export function getInnerTextFromJsxElement(element: JSX.Element): string {
return getInnerTextFromJsxElementRecursive(element).replace(/\s+/g, ' ').trim();
return getInnerTextFromJsxElementRecursive(element)
.replace(/\s+/g, ' ')
.trim();
}

function getInnerTextFromJsxElementRecursive(element: JSX.Element): string {
Expand Down
5 changes: 4 additions & 1 deletion src/injected/frameCommunicators/frame-communicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export class FrameCommunicator {
private doesFrameSupportScripting(frame: HTMLIFrameElement): boolean {
return (
!frame.hasAttribute('sandbox') ||
frame.getAttribute('sandbox').toLocaleLowerCase().lastIndexOf('allow-scripts') >= 0
frame
.getAttribute('sandbox')
.toLocaleLowerCase()
.lastIndexOf('allow-scripts') >= 0
);
}

Expand Down
7 changes: 6 additions & 1 deletion src/injected/visualization/svg-drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ export class SVGDrawer extends BaseDrawer {

const result = chain(this.tabbedElements)
.filter((element: TabbedItem) => element.shouldRedraw)
.map(tabbed => chain(tabbed.focusIndicator).values().compact().value())
.map(tabbed =>
chain(tabbed.focusIndicator)
.values()
.compact()
.value(),
)
.flatten()
.value();

Expand Down
5 changes: 4 additions & 1 deletion src/reports/report-name-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export class ReportNameGenerator {
}

private getTitleSegment(pageTitle: string): string {
return Array.from(pageTitle).filter(this.isValidCharForTitle).slice(0, 20).join('');
return Array.from(pageTitle)
.filter(this.isValidCharForTitle)
.slice(0, 20)
.join('');
}

private isValidCharForTitle(character: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/electron/common/scan-for-accessibility-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function scanForAccessibilityIssues(
const elementContext =
selectorInEvaluate === null ? document : { include: [selectorInEvaluate] };

axe.run(elementContext, options, function (err: Error, results: any): void {
axe.run(elementContext, options, function(err: Error, results: any): void {
if (err) {
throw err;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/electron/setup/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import * as testResourceServer from '../../miscellaneous/test-resource-server/re
import { testResourceServerConfig } from './test-resource-server-config';

// tslint:disable-next-line:no-default-export
export default function (): void {
export default function(): void {
testResourceServer.startServer(testResourceServerConfig);
}
2 changes: 1 addition & 1 deletion src/tests/electron/setup/global-teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import * as testResourceServer from '../../miscellaneous/test-resource-server/resource-server';

// tslint:disable-next-line:no-default-export
export default function (): void {
export default function(): void {
testResourceServer.stopAllServers();
}
2 changes: 1 addition & 1 deletion src/tests/end-to-end/setup/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import * as testResourceServer from '../../miscellaneous/test-resource-server/re
import { testResourceServerConfig } from './test-resource-server-config';

// tslint:disable-next-line:no-default-export
export default function (): void {
export default function(): void {
testResourceServer.startServer(testResourceServerConfig);
}
2 changes: 1 addition & 1 deletion src/tests/end-to-end/setup/global-teardown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import * as testResourceServer from '../../miscellaneous/test-resource-server/resource-server';

// tslint:disable-next-line:no-default-export
export default function (): void {
export default function(): void {
testResourceServer.stopAllServers();
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ describe('HighContrastSettings', () => {
.setup(creator => creator.setHighContrastMode(!enabled))
.verifiable(Times.once());

wrapper.dive().find(Toggle).simulate('click');
wrapper
.dive()
.find(Toggle)
.simulate('click');

userConfigMessageCreatorMock.verifyAll();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ describe('TelemetrySettings', () => {
.setup(creator => creator.setTelemetryState(!enabled))
.verifiable(Times.once());

wrapper.dive().find(Toggle).simulate('click');
wrapper
.dive()
.find(Toggle)
.simulate('click');

userConfigMessageCreatorMock.verifyAll();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ describe('FailureInstancePanelControlTest', () => {
const wrapper = shallow<FailureInstancePanelControl>(
<FailureInstancePanelControl {...props} />,
);
wrapper.find(TextField).props().onChange(null, description);
wrapper
.find(TextField)
.props()
.onChange(null, description);

expect(wrapper.state().currentInstance.failureDescription).toEqual(description);
});
Expand Down Expand Up @@ -132,8 +135,14 @@ describe('FailureInstancePanelControlTest', () => {
const wrapper = shallow<FailureInstancePanelControl>(
<FailureInstancePanelControl {...props} />,
);
wrapper.find(TextField).props().onChange(eventStub, 'a previously entered description');
wrapper.find(ActionButton).props().onClick(eventStub);
wrapper
.find(TextField)
.props()
.onChange(eventStub, 'a previously entered description');
wrapper
.find(ActionButton)
.props()
.onClick(eventStub);

expect(wrapper.state().isPanelOpen).toBe(true);
expect(wrapper.state().currentInstance.failureDescription).toEqual(
Expand All @@ -150,9 +159,15 @@ describe('FailureInstancePanelControlTest', () => {
<FailureInstancePanelControl {...props} />,
);

wrapper.find(TextField).props().onChange(null, description);
wrapper
.find(TextField)
.props()
.onChange(null, description);

wrapper.find(GenericPanel).props().onDismiss();
wrapper
.find(GenericPanel)
.props()
.onDismiss();

expect(wrapper.state().isPanelOpen).toBe(false);

Expand Down Expand Up @@ -182,9 +197,15 @@ describe('FailureInstancePanelControlTest', () => {
<FailureInstancePanelControl {...props} />,
);

wrapper.find(TextField).props().onChange(null, description);
wrapper
.find(TextField)
.props()
.onChange(null, description);

wrapper.find(ActionAndCancelButtonsComponent).props().primaryButtonOnClick(null);
wrapper
.find(ActionAndCancelButtonsComponent)
.props()
.primaryButtonOnClick(null);

expect(wrapper.state().isPanelOpen).toBe(false);

Expand Down Expand Up @@ -212,9 +233,15 @@ describe('FailureInstancePanelControlTest', () => {
const wrapper = shallow<FailureInstancePanelControl>(
<FailureInstancePanelControl {...props} />,
);
wrapper.find(TextField).props().onChange(null, description);

wrapper.find(ActionAndCancelButtonsComponent).props().primaryButtonOnClick(null);
wrapper
.find(TextField)
.props()
.onChange(null, description);

wrapper
.find(ActionAndCancelButtonsComponent)
.props()
.primaryButtonOnClick(null);

expect(wrapper.state().isPanelOpen).toBe(false);

Expand Down
2 changes: 1 addition & 1 deletion src/tests/unit/tests/background/stores/base-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('BaseStoreTest', () => {
const changedListener = Mock.ofInstance((testStore: TestStore, args: any) => {},
MockBehavior.Strict);

const listenerAdder = function (): void {
const listenerAdder = function(): void {
// hack to access onGetCurrentState from the BaseStore class
// tslint:disable-next-line:no-invalid-this
this.onGetCurrentState();
Expand Down
5 changes: 4 additions & 1 deletion src/tests/unit/tests/common/document-manipulator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ describe('DocumentManipulator', () => {

setter.setShortcutIcon(expectedHref);

const actualHref = document.querySelector('link').getAttribute('href').valueOf();
const actualHref = document
.querySelector('link')
.getAttribute('href')
.valueOf();
expect(actualHref).toEqual(expectedHref);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/unit/tests/common/indexedDB/indexedDB.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('IndexedDBUtil test cases', () => {
let store;
beforeAll(() => {
const request = fakeIndexedDB.open(defaultDBName, 3);
request.onupgradeneeded = function (): void {
request.onupgradeneeded = function(): void {
const db = request.result;
store = db.createObjectStore(defaultStoreName);
};
Expand Down
Loading

0 comments on commit eba86b2

Please sign in to comment.