Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a15803b9
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a15803b9
编写于
2月 04, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
smoke test - add attribute for tabs to simplify lookup
上级
cfc452e4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
15 deletion
+24
-15
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
+10
-1
test/automation/src/editors.ts
test/automation/src/editors.ts
+9
-9
test/smoke/src/areas/workbench/data-loss.test.ts
test/smoke/src/areas/workbench/data-loss.test.ts
+3
-3
test/smoke/src/areas/workbench/data-migration.test.ts
test/smoke/src/areas/workbench/data-migration.test.ts
+2
-2
未找到文件。
src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
浏览文件 @
a15803b9
...
...
@@ -42,6 +42,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
withNullAsUndefined
,
assertAllDefined
,
assertIsDefined
}
from
'
vs/base/common/types
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
basenameOrAuthority
}
from
'
vs/base/common/resources
'
;
interface
IEditorInputLabel
{
name
?:
string
;
...
...
@@ -941,7 +942,15 @@ export class TabsTitleControl extends TitleControl {
tabContainer
.
title
=
title
;
// Label
tabLabelWidget
.
setResource
({
name
,
description
,
resource
:
toResource
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
MASTER
})
},
{
title
,
extraClasses
:
[
'
tab-label
'
],
italic
:
!
this
.
group
.
isPinned
(
editor
)
});
const
resource
=
toResource
(
editor
,
{
supportSideBySide
:
SideBySideEditor
.
MASTER
});
tabLabelWidget
.
setResource
({
name
,
description
,
resource
},
{
title
,
extraClasses
:
[
'
tab-label
'
],
italic
:
!
this
.
group
.
isPinned
(
editor
)
});
// Tests helper
if
(
resource
)
{
tabContainer
.
setAttribute
(
'
data-resource-name
'
,
basenameOrAuthority
(
resource
));
}
else
{
tabContainer
.
removeAttribute
(
'
data-resource-name
'
);
}
}
private
redrawEditorActiveAndDirty
(
isGroupActive
:
boolean
,
editor
:
IEditorInput
,
tabContainer
:
HTMLElement
,
tabLabelWidget
:
IResourceLabel
):
void
{
...
...
test/automation/src/editors.ts
浏览文件 @
a15803b9
...
...
@@ -17,27 +17,27 @@ export class Editors {
}
}
async
selectTab
(
tabName
:
string
,
untitled
:
boolean
=
false
):
Promise
<
void
>
{
await
this
.
code
.
waitAndClick
(
`.tabs-container div.tab[
aria-label="
${
tabName
}
, tab
"]`
);
await
this
.
waitForEditorFocus
(
tabName
,
untitled
);
async
selectTab
(
fileName
:
string
):
Promise
<
void
>
{
await
this
.
code
.
waitAndClick
(
`.tabs-container div.tab[
data-resource-name$="
${
fileName
}
"]`
);
await
this
.
waitForEditorFocus
(
fileName
);
}
async
waitForActiveEditor
(
file
n
ame
:
string
):
Promise
<
any
>
{
const
selector
=
`.editor-instance .monaco-editor[data-uri$="
${
file
n
ame
}
"] textarea`
;
async
waitForActiveEditor
(
file
N
ame
:
string
):
Promise
<
any
>
{
const
selector
=
`.editor-instance .monaco-editor[data-uri$="
${
file
N
ame
}
"] textarea`
;
return
this
.
code
.
waitForActiveElement
(
selector
);
}
async
waitForEditorFocus
(
fileName
:
string
,
untitled
:
boolean
=
false
):
Promise
<
void
>
{
async
waitForEditorFocus
(
fileName
:
string
):
Promise
<
void
>
{
await
this
.
waitForActiveTab
(
fileName
);
await
this
.
waitForActiveEditor
(
fileName
);
}
async
waitForActiveTab
(
fileName
:
string
,
isDirty
:
boolean
=
false
):
Promise
<
void
>
{
await
this
.
code
.
waitForElement
(
`.tabs-container div.tab.active
${
isDirty
?
'
.dirty
'
:
''
}
[aria-selected="true"][
aria-label="
${
fileName
}
, tab
"]`
);
await
this
.
code
.
waitForElement
(
`.tabs-container div.tab.active
${
isDirty
?
'
.dirty
'
:
''
}
[aria-selected="true"][
data-resource-name$="
${
fileName
}
"]`
);
}
async
waitForTab
(
fileName
:
string
,
isDirty
:
boolean
=
false
):
Promise
<
void
>
{
await
this
.
code
.
waitForElement
(
`.tabs-container div.tab
${
isDirty
?
'
.dirty
'
:
''
}
[
aria-label="
${
fileName
}
, tab
"]`
);
await
this
.
code
.
waitForElement
(
`.tabs-container div.tab
${
isDirty
?
'
.dirty
'
:
''
}
[
data-resource-name$="
${
fileName
}
"]`
);
}
async
newUntitledFile
():
Promise
<
void
>
{
...
...
@@ -47,6 +47,6 @@ export class Editors {
await
this
.
code
.
dispatchKeybinding
(
'
ctrl+n
'
);
}
await
this
.
waitForEditorFocus
(
'
Untitled-1
'
,
true
);
await
this
.
waitForEditorFocus
(
'
Untitled-1
'
);
}
}
test/smoke/src/areas/workbench/data-loss.test.ts
浏览文件 @
a15803b9
...
...
@@ -12,7 +12,7 @@ export function setup() {
await
app
.
workbench
.
editors
.
newUntitledFile
();
const
untitled
=
'
Untitled-1
'
;
const
textToTypeInUntitled
=
untitled
;
const
textToTypeInUntitled
=
'
Hello from Untitled
'
;
await
app
.
workbench
.
editor
.
waitForTypeInEditor
(
untitled
,
textToTypeInUntitled
);
const
readmeMd
=
'
readme.md
'
;
...
...
@@ -25,8 +25,8 @@ export function setup() {
await
app
.
workbench
.
editors
.
waitForActiveTab
(
readmeMd
,
true
);
await
app
.
workbench
.
editor
.
waitForEditorContents
(
readmeMd
,
c
=>
c
.
indexOf
(
textToType
)
>
-
1
);
await
app
.
workbench
.
editors
.
waitForTab
(
untitled
,
true
);
await
app
.
workbench
.
editors
.
selectTab
(
untitled
,
true
);
await
app
.
workbench
.
editors
.
waitForTab
(
untitled
);
await
app
.
workbench
.
editors
.
selectTab
(
untitled
);
await
app
.
workbench
.
editor
.
waitForEditorContents
(
untitled
,
c
=>
c
.
indexOf
(
textToTypeInUntitled
)
>
-
1
);
});
});
...
...
test/smoke/src/areas/workbench/data-migration.test.ts
浏览文件 @
a15803b9
...
...
@@ -66,7 +66,7 @@ export function setup(stableCodePath: string, testDataPath: string) {
await
stableApp
.
workbench
.
editors
.
newUntitledFile
();
const
untitled
=
'
Untitled-1
'
;
const
textToTypeInUntitled
=
untitled
;
const
textToTypeInUntitled
=
'
Hello from Untitled
'
;
await
stableApp
.
workbench
.
editor
.
waitForTypeInEditor
(
untitled
,
textToTypeInUntitled
);
const
readmeMd
=
'
readme.md
'
;
...
...
@@ -86,7 +86,7 @@ export function setup(stableCodePath: string, testDataPath: string) {
await
insidersApp
.
workbench
.
editor
.
waitForEditorContents
(
readmeMd
,
c
=>
c
.
indexOf
(
textToType
)
>
-
1
);
await
insidersApp
.
workbench
.
editors
.
waitForTab
(
untitled
,
true
);
await
insidersApp
.
workbench
.
editors
.
selectTab
(
untitled
,
true
);
await
insidersApp
.
workbench
.
editors
.
selectTab
(
untitled
);
await
insidersApp
.
workbench
.
editor
.
waitForEditorContents
(
untitled
,
c
=>
c
.
indexOf
(
textToTypeInUntitled
)
>
-
1
);
await
insidersApp
.
stop
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录