Skip to content

Commit d28b97e

Browse files
authored
[PoC] try DBP click for bookmark import (#1965)
* Use DBP for running execution
1 parent 86cf6c2 commit d28b97e

File tree

15 files changed

+148
-203
lines changed

15 files changed

+148
-203
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ injected/src/element-hiding.js @duckduckgo/content-scope-scripts-owners @jonatha
1010
injected/src/features/click-to-load.js @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
1111
injected/src/features/click-to-load/ @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
1212
injected/src/locales/click-to-load/ @duckduckgo/content-scope-scripts-owners @kzar @ladamski @franfaccin @jonathanKingston @shakyShane
13-
injected/src/features/autofill-password-import.js @duckduckgo/content-scope-scripts-owners @dbajpeyi
13+
injected/src/features/autofill-import.js @duckduckgo/content-scope-scripts-owners @dbajpeyi
1414

1515
# Broker protection
1616
injected/src/features/broker-protection.js @duckduckgo/content-scope-scripts-owners @duckduckgo/injected-broker-protection

injected/integration-test/autofill-password-import.spec.js renamed to injected/integration-test/autofill-import.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { test, expect } from '@playwright/test';
2-
import { OVERLAY_ID } from '../src/features/autofill-password-import';
2+
import { OVERLAY_ID } from '../src/features/autofill-import';
33
import { ResultsCollector } from './page-objects/results-collector.js';
44

5-
const HTML = '/autofill-password-import/index.html';
6-
const CONFIG = './integration-test/test-pages/autofill-password-import/config/config.json';
5+
const HTML = '/autofill-import/index.html';
6+
const CONFIG = './integration-test/test-pages/autofill-import/config/config.json';
77

88
test('Password import feature', async ({ page }, testInfo) => {
99
const collector = ResultsCollector.create(page, testInfo.project.use);
1010
await collector.load(HTML, CONFIG);
1111

12-
const passwordImportFeature = new AutofillPasswordImportSpec(page);
12+
const passwordImportFeature = new AutofillImportSpec(page);
1313
await passwordImportFeature.clickOnElement('Home page');
1414
await passwordImportFeature.waitForAnimation();
1515

@@ -25,7 +25,7 @@ test('Password import feature', async ({ page }, testInfo) => {
2525
await expect(overlay).not.toBeVisible();
2626
});
2727

28-
class AutofillPasswordImportSpec {
28+
class AutofillImportSpec {
2929
/**
3030
* @param {import("@playwright/test").Page} page
3131
*/

injected/integration-test/page-objects/results-collector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class ResultsCollector {
163163
android: async () => {
164164
// noop
165165
},
166-
'android-autofill-password-import': async () => {
166+
'android-autofill-import': async () => {
167167
// noop
168168
},
169169
});
@@ -173,7 +173,7 @@ export class ResultsCollector {
173173
'apple-isolated': () => mockWebkitMessaging,
174174
windows: () => mockWindowsMessaging,
175175
android: () => mockAndroidMessaging,
176-
'android-autofill-password-import': () => mockAndroidMessaging,
176+
'android-autofill-import': () => mockAndroidMessaging,
177177
});
178178

179179
await this.page.addInitScript(messagingMock, {
@@ -187,7 +187,7 @@ export class ResultsCollector {
187187
'apple-isolated': () => wrapWebkitScripts,
188188
apple: () => wrapWebkitScripts,
189189
android: () => wrapWebkitScripts,
190-
'android-autofill-password-import': () => wrapWebkitScripts,
190+
'android-autofill-import': () => wrapWebkitScripts,
191191
windows: () => wrapWindowsScripts,
192192
});
193193

injected/integration-test/type-helpers.mjs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Build {
6161
android: () => '../build/android/contentScope.js',
6262
apple: () => '../build/apple/contentScope.js',
6363
'apple-isolated': () => '../build/apple/contentScopeIsolated.js',
64-
'android-autofill-password-import': () => '../build/android/autofillPasswordImport.js',
64+
'android-autofill-import': () => '../build/android/autofillImport.js',
6565
'android-broker-protection': () => '../build/android/brokerProtection.js',
6666
});
6767
return readFileSync(path, 'utf8');
@@ -73,16 +73,7 @@ export class Build {
7373
*/
7474
static supported(name) {
7575
/** @type {ImportMeta['injectName'][]} */
76-
const items = [
77-
'apple',
78-
'apple-isolated',
79-
'windows',
80-
'integration',
81-
'android',
82-
'android-autofill-password-import',
83-
'chrome-mv3',
84-
'firefox',
85-
];
76+
const items = ['apple', 'apple-isolated', 'windows', 'integration', 'android', 'android-autofill-import', 'chrome-mv3', 'firefox'];
8677
if (items.includes(name)) {
8778
return name;
8879
}

injected/playwright.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export default defineConfig({
5555
use: { injectName: 'android', platform: 'android', ...devices['Galaxy S5'] },
5656
},
5757
{
58-
name: 'android-autofill-password-import',
59-
testMatch: ['integration-test/autofill-password-import.spec.js'],
60-
use: { injectName: 'android-autofill-password-import', platform: 'android', ...devices['Galaxy S5'] },
58+
name: 'android-autofill-import',
59+
testMatch: ['integration-test/autofill-import.spec.js'],
60+
use: { injectName: 'android-autofill-import', platform: 'android', ...devices['Galaxy S5'] },
6161
},
6262
{
6363
name: 'chrome-mv3',

injected/scripts/entry-points.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const builds = {
3131
input: 'entry-points/android.js',
3232
output: ['../build/android/brokerProtection.js'],
3333
},
34-
'android-autofill-password-import': {
34+
'android-autofill-import': {
3535
input: 'entry-points/android.js',
36-
output: ['../build/android/autofillPasswordImport.js'],
36+
output: ['../build/android/autofillImport.js'],
3737
},
3838
'android-adsjs': {
3939
input: 'entry-points/android-adsjs.js',

injected/src/features.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const otherFeatures = /** @type {const} */ ([
2828
'brokerProtection',
2929
'performanceMetrics',
3030
'breakageReporting',
31-
'autofillPasswordImport',
31+
'autofillImport',
3232
'favicon',
3333
'webTelemetry',
3434
'pageContext',
@@ -50,7 +50,7 @@ export const platformSupport = {
5050
],
5151
android: [...baseFeatures, 'webCompat', 'breakageReporting', 'duckPlayer', 'messageBridge'],
5252
'android-broker-protection': ['brokerProtection'],
53-
'android-autofill-password-import': ['autofillPasswordImport'],
53+
'android-autofill-import': ['autofillImport'],
5454
'android-adsjs': [
5555
'apiManipulation',
5656
'webCompat',

0 commit comments

Comments
 (0)