Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/test/browser/webview.test.ts
4778 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import assert from 'assert';
7
import { parentOriginHash } from '../../../base/browser/iframe.js';
8
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../base/test/common/utils.js';
9
10
suite('parentOriginHash', () => {
11
12
test('localhost 1', async () => {
13
const hash = await parentOriginHash('http://localhost:9888', '123456');
14
assert.strictEqual(hash, '0fnsiac2jaup1t266qekgr7iuj4pnm31gf8r0h1o6k2lvvmfh6hk');
15
});
16
17
test('localhost 2', async () => {
18
const hash = await parentOriginHash('http://localhost:9888', '123457');
19
assert.strictEqual(hash, '07shf01bmdfrghk96voldpletbh36vj7blnl4td8kdq1sej5kjqs');
20
});
21
22
test('localhost 3', async () => {
23
const hash = await parentOriginHash('http://localhost:9887', '123456');
24
assert.strictEqual(hash, '1v1128i162q0nee9l89360sqan26u3pdnjrkke5ijd0sel8sbtqf');
25
});
26
27
ensureNoDisposablesAreLeakedInTestSuite();
28
});
29
30