Skip to content

Commit

Permalink
Merge branch 'develop' into chore/sentry-upgrade-8
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 authored Jul 24, 2024
2 parents cc3f162 + f861486 commit 9dfbdc4
Show file tree
Hide file tree
Showing 133 changed files with 2,164 additions and 1,113 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ workflows:
- test-e2e-mmi-playwright - OPTIONAL:
requires:
- prep-build-test-mmi-playwright
- test-e2e-swap-playwright - OPTIONAL:
requires:
- prep-build
- test-e2e-chrome-rpc-mmi:
requires:
- prep-build-test-mmi
Expand Down
2 changes: 1 addition & 1 deletion .circleci/scripts/git-diff-develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function storeGitDiffOutput() {

// Store the output of git diff
const outputPath = path.resolve(outputDir, 'changed-files.txt');
fs.writeFileSync(outputPath, diffOutput);
fs.writeFileSync(outputPath, diffOutput.trim());

console.log(`Git diff results saved to ${outputPath}`);
process.exit(0);
Expand Down
3 changes: 0 additions & 3 deletions app/_locales/de/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/el/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/en/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/es/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/fr/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/hi/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/id/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/ja/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/ko/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/pt/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/ru/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/tl/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/tr/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/vi/messages.json

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

3 changes: 0 additions & 3 deletions app/_locales/zh_CN/messages.json

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

9 changes: 9 additions & 0 deletions app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { checkForLastErrorAndLog } from '../../shared/modules/browser-runtime.ut
import { isManifestV3 } from '../../shared/modules/mv3.utils';
import { maskObject } from '../../shared/modules/object.utils';
import { FIXTURE_STATE_METADATA_VERSION } from '../../test/e2e/default-fixture';
import { getSocketBackgroundToMocha } from '../../test/e2e/background-socket/socket-background-to-mocha';
import {
OffscreenCommunicationTarget,
OffscreenCommunicationEvents,
Expand Down Expand Up @@ -401,6 +402,14 @@ async function initialize() {

let isFirstMetaMaskControllerSetup;

// We only want to start this if we are running a test build, not for the release build.
// `navigator.webdriver` is true if Selenium, Puppeteer, or Playwright are running.
// In MV3, the Service Worker sees `navigator.webdriver` as `undefined`, so this will trigger from
// an Offscreen Document message instead. Because it's a singleton class, it's safe to start multiple times.
if (process.env.IN_TEST && window.navigator?.webdriver) {
getSocketBackgroundToMocha();
}

if (isManifestV3) {
// Save the timestamp immediately and then every `SAVE_TIMESTAMP_INTERVAL`
// miliseconds. This keeps the service worker alive.
Expand Down
7 changes: 7 additions & 0 deletions app/scripts/offscreen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { captureException } from '@sentry/browser';
import { OffscreenCommunicationTarget } from '../../shared/constants/offscreen-communication';
import { getSocketBackgroundToMocha } from '../../test/e2e/background-socket/socket-background-to-mocha';

/**
* Creates an offscreen document that can be used to load additional scripts
Expand All @@ -25,6 +26,12 @@ export async function createOffscreen() {
offscreenDocumentLoadedListener,
);
resolve();

// If the Offscreen Document sees `navigator.webdriver === true` and we are in a test environment,
// start the SocketBackgroundToMocha.
if (process.env.IN_TEST && msg.webdriverPresent) {
getSocketBackgroundToMocha();
}
}
};
chrome.runtime.onMessage.addListener(offscreenDocumentLoadedListener);
Expand Down
2 changes: 2 additions & 0 deletions development/build/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function createManifestTasks({
...manifest.permissions,
'webRequestBlocking',
'http://localhost/*',
'tabs', // test builds need tabs permission for switchToWindowWithTitle
];
});

Expand All @@ -80,6 +81,7 @@ function createManifestTasks({
...manifest.permissions,
'webRequestBlocking',
'http://localhost/*',
'tabs', // test builds need tabs permission for switchToWindowWithTitle
];
});

Expand Down
Loading

0 comments on commit 9dfbdc4

Please sign in to comment.